Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    Filter TreeGrid

    Hi Isomorphic,

    Can we filter TreeGrid on client side when it has all the data? I know that it works fine for ListGrid but for TreeGrid it makes a fetch call to server every time I try to filter, even though it has all the data on client.

    Thanks,
    lchen

    #2
    You can use a clientOnly:true DataSource to avoid further calls to the server, however, note that the filtering that you do with fetchData() isn't tree-oriented, that is, if a child node passes the filter criteria but it's parent does not, the child is absent from the tree.

    If you need this kind of filtering behavior, note you can still re-use most of the filtering system because you can call DataSource.applyFilter() to test if individual records match filter criteria.

    Comment


      #3
      TreeGrid is editable, so I can not use client only dataSource. Is it possible to filter it on client(like ListGrid) when it has all the data and avoid requests to server for filter?

      Comment


        #4
        Yes, but it's going to take some custom coding. Create a ResultTree directly instead of calling fetchData(), and override fetchData() to rebuild the ResultTree based on your own tree filtering code any time it's called.

        In this case TreeGrid editing will work normally and save to the DataSource and the ResultTree will automatically update the tree nodes and structure to match. But you're taking over the fetch operation and interpretation of criteria.

        If you'd rather not deal with all these details, it's something you could sponsor.

        Comment

        Working...
        X