allow expand/collapse while filtered, but dont fully expand

Discuss issues related to v3.x
Post Reply
User avatar
Christian Semrau
Posts: 149
Joined: Thu Apr 24, 2014 1:19 pm
Location: Germany

allow expand/collapse while filtered, but dont fully expand

Post by Christian Semrau » Fri Jul 03, 2015 4:18 pm

I am upgrading from Gantt 2.5.6 to 3.0.5.

When filtering the tree, I need to keep the selection and expansion state as much as possible, while still allowing manual expand/collapse while the tree is filtered.

In Gantt 2.5.6, I accomplished that by manually saving and restoring selection and expansion state around calls to filterTreeBy() and refreshNodeStoreContent().

In Gantt 3.0.5, it seems the selection and expansion state during filtering is already kept by Ext. When I disable my own store/restore, and also set allowExpandCollapseWhileFiltered=false on the TaskStore, the selection and expansion state is kept exactly as I need.

But setting allowExpandCollapseWhileFiltered=false also has the effect of disabling the expand/collapse feature.

It seems what I need can be accomplished by just suppressing node expansion during filter application.

Regards,
Christian Semrau

User avatar
Christian Semrau
Posts: 149
Joined: Thu Apr 24, 2014 1:19 pm
Location: Germany

Re: allow expand/collapse while filtered, but dont fully exp

Post by Christian Semrau » Fri Jul 03, 2015 4:36 pm

Well, I just did exactly what I suggested - suppress automatic expansion, while leaving allowExpandCollapseWhileFiltered at its default value (true). And it works (or so it seems for now).

In my TaskStore subclass, I added this method.

Code: Select all

    // override mixin FilterableTreeStore
    markFilteredNodes: function () {
        // Disable automatic expansion of nodes.
        // See also http://www.bryntum.com/forum/viewtopic.php?f=33&t=6353
        var prev = this.allowExpandCollapseWhileFiltered;
        this.allowExpandCollapseWhileFiltered = false;
        this.callParent(arguments);
        this.allowExpandCollapseWhileFiltered = prev;
    },
What do you think of adding yet another config option, to customize automatic expansion during filtering separately from allowing expand/collapse while filtered?

Regards,
Christian Semrau

User avatar
Maxim Gorkovsky
Core Developer
Core Developer
Posts: 3060
Joined: Wed Jan 08, 2014 11:46 am

Re: allow expand/collapse while filtered, but dont fully exp

Post by Maxim Gorkovsky » Thu Dec 24, 2015 7:26 pm

We made a ticket to track this feature request: https://www.assembla.com/spaces/bryntum/tickets/2295

User avatar
nickolay
Core Developer
Core Developer
Posts: 3399
Joined: Mon May 16, 2011 10:48 am

Re: allow expand/collapse while filtered, but dont fully exp

Post by nickolay » Fri Oct 07, 2016 11:01 am

Added "keepExpandStateWhileFiltered" flag for the upcoming "5.0" release.
We offer training in both Ext JS and our products, read more here.
Read the API documentation

Post Reply