Clearing TreePanel filter causes inner nodes to move to a different parent node

  1. #1

    Clearing TreePanel filter causes inner nodes to move to a different parent node

    Hi,
    After copying the sample from the example page to my app I noticed something strange, even though the filter works fine when I clear it the nodes which were contained within several different groups will now display inside just one group which happens to be the last one. By expanding the empty groups which used to contain the nodes before clearing the filter fixes the problem, it seems that when I expand them the tree panel realizes that there were nodes there which are in the wrong place and moves them back in place.

    Here's my code:

    var FilterItems= function (sender, e)
    {
       var tree = App.MyTree,
       store = tree.store,
       logic = tree;
    
       //Here's where the problem lines, the second time that this gets called
       //the nodes will all move from their own parent node to the last parent node on the tree.
       logic.clearFilter();
    
       //The sender is a check box, if checked we apply the filter
       if (sender.getValue())
       {
          logic.filterBy(function (node)
          {
             //This is a custom attribute that I add to the nodes on the code behind,
             //it works no problem
             return node.data.status== "on";
          });
       }
    };
    
    
    var clearFilter = function ()
    {
       var tree = App.MyTree,
       store = tree.store,
       logic = tree;
    
       logic.clearFilter(true);
       tree.getView().focus();
    };
    Last edited by paul-2011; Apr 30, 2015 at 6:43 PM.

Similar Threads

  1. Replies: 4
    Last Post: Mar 22, 2015, 4:04 PM
  2. [CLOSED] Nodes in TreePanel dissapear after collapsing another node
    By profitsistemas in forum 2.x Legacy Premium Help
    Replies: 4
    Last Post: May 28, 2013, 1:11 PM
  3. Replies: 16
    Last Post: Jul 19, 2011, 3:53 AM
  4. [CLOSED] select node and expand parent nodes
    By LeeTheGreek in forum 1.x Legacy Premium Help
    Replies: 3
    Last Post: May 13, 2011, 12:06 PM
  5. treepanel node not move
    By thiefo in forum 1.x Help
    Replies: 1
    Last Post: Jun 14, 2010, 8:54 AM

Tags for this Thread

Posting Permissions