Announcement

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

    Filtering a TreeGrid with a manually constructed Tree

    I'm trying to get local filtering working in a TreeGrid, using data from a manually constructed Tree (needs to be built dynamically based on the user logged in, etc) and passing it to the TreeGrid. I've seen that TreeGrids require a DataSource in order to use filtering, so I've been trying to set up a datasource to work locally, but still do the filtering on the data from my original Tree. Is it possible to set this up?

    I can't seem to get around the datasource trying to fetch data, whether it is from the server or a client-only request, instead of using the original Tree I passed to the grid. I have looked at DataSource.setCacheData(), but it appears that the structure of the tree is lost when I do that.

    Thanks

    Configuration:
    v8.3p_2012-12-10/LGPL Development Only (built 2012-12-10)
    GWT 2.5
    Chrome

    #2
    setCacheData() with a clientOnly DataSource is the right approach, but you need to set up Records that will form a valid tree via id -> parentId linking. See the Tree DataBinding overview.

    Comment


      #3
      I can confirm that this does work with a manually constructed Tree. I had been calling Tree.add() and specifying the parent of each node, but I didn't have the proper parentId attributes set up in my records.

      Thanks for the response

      Comment

      Working...
      X