Results 1 to 5 of 5

Thread: TreeList shows filtered entries

  1. #1
    Sencha Premium User alexander.urban's Avatar
    Join Date
    Nov 2013
    Posts
    324
    Answers
    9

    Default Answered: TreeList shows filtered entries

    I have made a fiddle to show my problem:

    https://fiddle.sencha.com/#fiddle/11nj

    I would have to update my TreeList when the filter is updated. It seems as if the current treelist does not update which items it shows when filters change. How can I force the treelist to refresh?

  2. I don't know that this light-weight component handles filtered store data - at least not in my testing and by observing the source. Changing the store updates the view, but regardless of whether the data is filtered, it seems to display it all.

    A TreePanel may be a better fit for this additional functionality.


  3. #2
    Sencha - Sustaining Engineer tristan.lee's Avatar
    Join Date
    Mar 2015
    Location
    Central Ohio
    Posts
    1,579
    Answers
    165

    Default

    I don't know that this light-weight component handles filtered store data - at least not in my testing and by observing the source. Changing the store updates the view, but regardless of whether the data is filtered, it seems to display it all.

    A TreePanel may be a better fit for this additional functionality.

    Tristan Lee
    Sencha Inc - Sustaining Engineer


    Having an issue? Help us help you - be detailed; provide some code; demonstrate with a fiddle (fiddle.sencha.com)

    Embed your fiddle in your post: [FIDDLE]id[/FIDDLE]

  4. #3
    Sencha Premium Member Zdeno's Avatar
    Join Date
    Nov 2009
    Location
    Prague
    Posts
    769
    Answers
    38

    Default

    The problem is also somewhere else. Ext.list.AbstractTreeItem simply ignore visible property when creating node structure. When you have a look at 6.2 EA the problem should be fixed
    Code:
    function updateNode - if (child.data.visible)
    Until official release you can use following overrides:

    PHP Code:
    Ext.define('App.overrides.list.Tree', {
        
    override'Ext.list.Tree',

        
    //fixed in 6.2.0, only apply to 6.0.2 and before
        
    compatibility '6.0.2.437',

        
    privates: {
            
    /**
             * Create a new list item.
             * @param {Ext.data.TreeModel} node The node backing the item.
             * @param {Ext.list.AbstractTreeItem} parent The parent item.
             * @return {Ext.list.AbstractTreeItem} The list item.
             *
             * @private
             */
            
    createItem: function (nodeparent) {
                var 
    me this,
                    
    item Ext.create(me.getItemConfig(nodeparent)),
                    
    toolsElement me.toolsElement,
                    
    toolElpreviousSibling;

                if (
    parent.isRootListItem) {
                    
    toolEl item.getToolElement();
                    if (
    toolEl) {
                        
    previousSibling me.findVisiblePreviousSibling(node);
                        if (!
    previousSibling) {
                            
    toolsElement.insertFirst(toolEl);
                        } else {
                            
    previousSibling me.getItem(previousSibling);
                            
    toolEl.insertAfter(previousSibling.getToolElement());
                        }
                        
    toolEl.dom.setAttribute('data-recordId'node.internalId);
                        
    toolEl.isTool true;
                    }
                }

                
    me.itemMap[node.internalId] = item;
                return 
    item;
            },

            
    findVisiblePreviousSibling: function(node) {
                var 
    sibling node.previousSibling;
                while (
    sibling) {
                    if (
    sibling.data.visible) {
                        return 
    sibling;
                    }
                    
    sibling sibling.previousSibling;
                }
                return 
    null;
            }
        }
    }); 
    PHP Code:
    Ext.define('App.overrides.list.AbstractTreeItem', {
        
    override'Ext.list.AbstractTreeItem',

        
    //fixed in 6.2.0, only apply to 6.0.2 and before
        
    compatibility '6.0.2.437',
        
        
    updateNode: function (node) {
            if (
    node) {
                var 
    me this,
                    
    map me.itemMap,
                    
    childNodesownerleniitemchild;

                
    me.element.dom.setAttribute('data-recordId'node.internalId);

                if (!
    map) {
                    
    childNodes node.childNodes;
                    
    owner me.getOwner();
                    
    me.itemMap map = {};
                    for (
    0len childNodes.lengthlen; ++i) {
                        
    child childNodes[i];
                        if (
    child.data.visible) {
                            
    item owner.createItem(childme);
                            
    map[child.internalId] = item;
                            
    me.insertItem(itemnull);
                        }
                    }
                }

                
    me.setExpanded(node.isExpanded());
                
    me.doNodeUpdate(node);
            }
        }
    }); 

  5. #4
    Sencha Premium User tlloyduk's Avatar
    Join Date
    Sep 2010
    Posts
    91
    Answers
    1

    Default

    Still seems to be a problem in 6.5.2.463

  6. #5

    Default

    Quote Originally Posted by tlloyduk View Post
    Still seems to be a problem in 6.5.2.463
    bump

Similar Threads

  1. Replies: 2
    Last Post: 18 Feb 2015, 11:18 AM
  2. Duplicate entries get filtered
    By wuytsr in forum Sencha Touch 2.x: Discussion
    Replies: 1
    Last Post: 15 Nov 2012, 6:13 AM
  3. Replies: 3
    Last Post: 23 Oct 2012, 6:04 AM
  4. Replies: 3
    Last Post: 20 Sep 2012, 10:35 AM
  5. ComboBox with JsonStore not displaying text of entries but entries exist
    By aaronbartell in forum Ext 3.x: Help & Discussion
    Replies: 3
    Last Post: 1 Jul 2010, 6:32 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •