[CLOSED] Remote Load of Nodes and configured filters

  1. #1

    [CLOSED] Remote Load of Nodes and configured filters

    Hello,

    I have a problem with the combination of using filters to a tree and loading childnodes of a node remotely.
    When I apply a filter my filter works fine on every node which is already loaded.

    But the filter is not applied to the nodes which I load after I set up the filter.
    Is there a property somewhere which I need to set to apply my configured filter to every node (not only the already loaded nodes)?


    Regards,

    Martin
    Last edited by Daniil; May 03, 2011 at 3:59 PM. Reason: [CLOSED]
  2. #2
    Hi,

    I guess your code is based on this example?
    https://examples1.ext.net/#/TreePanel/Advanced/Filter/

    I can't see any way to apply the filter which is not loaded yet.

    But you should be able to apply filters when new nodes are added to a tree. Please use TreePanel's Append listener.
    <Append Handler="someCodeToApplyFilters" Buffer="200" />
  3. #3
    Hi Daniil,

    thanks for the answer. And yes, that was my basic example I was referring to.

    I also thought about applying the same filter after every append event.

    But AFAIK the filter always applied to the whole try and not only the just loaded node-subset.
    Is that true?

    If yes... is there a way to apply a filter to a just loaded node and its childnodes?



    Regards,

    Martin
  4. #4
    Hi,

    is there a way to apply a filter to a just loaded node and its childnodes?

    Just pass required node as startNode field in the second argument (config object)
    tree.filterBy(function (node) {
         return re.test(node.text);
    }, {startNode : requiredNode});
  5. #5
    It looks I misunderstood your requirement.

    Yes, the filter is applied for all tree by default. But you can set a startNode to filter.

    As you can see in the Ext.Net sources the piece of filterBy method looks:
    filterBy : function (fn, config) {
        config = config || {};
        var startNode = config.startNode || this.root;
    So, to set a startNode:
    tree.filterBy(someFunction(), { startNode: someNode})
  6. #6

    CLOSED

    That works fine. Thank you!

Similar Threads

  1. [CLOSED] [Razor] TreePanel load nodes from controller action
    By boris in forum 2.x Legacy Premium Help
    Replies: 8
    Last Post: May 18, 2012, 9:43 AM
  2. Replies: 3
    Last Post: Jan 12, 2012, 3:26 PM
  3. [CLOSED] Header filters and remote paging
    By rthiney in forum 1.x Legacy Premium Help
    Replies: 1
    Last Post: Oct 12, 2011, 7:48 PM
  4. [CLOSED] Remote-Load of a Subtree without expanding nodes
    By macap in forum 1.x Legacy Premium Help
    Replies: 1
    Last Post: May 31, 2011, 11:59 AM
  5. Blocking load child nodes with dbclick of treegrid row
    By Thiago Nogueira in forum 1.x Help
    Replies: 1
    Last Post: Nov 29, 2010, 12:42 PM

Posting Permissions