Announcement

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

    filter TreeGrid

    Hi,

    Is it possible to filter TreeGrid on the client only? It works for ListGrid when it has all the data on the client but for TreeGrid it seems to me that it always initiate a fetch request to the server even if it got all the data.

    Please help.

    #2
    Please help, anyone?

    Comment


      #3
      Client-side Tree filtering is not (yet) a built-in feature, but can be achieved with custom code. Another option is Feature Sponsorship.

      Comment


        #4
        knguyen,

        I did this way:

        Create a Datasource as usual(Foreign Key -> Primary Key), and:

        Code:
        		datasource.setClientOnly(true);
        		datasource.setTestData(...);

        Create a TreeGrid:

        Code:
        		// Tree Grid
        		this.treeGrid = new TreeGrid();
        		// ...
        		this.treeGrid.setLoadDataOnDemand(false);
        		this.treeGrid.setDataSource(dataSource);
        		this.treeGrid.setAutoFetchData(true);
        		this.treeGrid.setShowFilterEditor(true);
        		this.treeGrid.setFilterOnKeypress(true);
        		this.treeGrid.setAutoFetchAsFilter(true);
        		// ...
        Regards,

        Comment


          #5
          Clever. That's true, a client-only DataSource approach will work so long as you don't need editing. Bear in mind that's not quite a true tree filtering interaction, because if a child matches the filter, all parents must also match the filter or the child won't be shown.

          Comment


            #6
            Yeah, you are right, need to write a recursive DataSource Filter function for this.

            Comment


              #7
              @terciof: did you manage to implement a recursive filter function? I'm faced with the exact same problem right now. I have a client-side only TreeGrid with a client-side datasource.

              I'm using SmartGWT 2.1 and GWT 2.0.3.

              Thanx,

              Thomas

              Comment


                #8
                Hi guys I have got 1 working solution for treegrid filteration if u want u can contact me.... bhola_only4u@yahoo.com

                Comment


                  #9
                  ok so how to roll our own

                  Hello,

                  So roughly how would one roll our own server side filter?

                  I have the filter, I send it over the wire as a critiera on the name field. But what to do with the parentid?

                  Could someone post their solution to this problem?

                  Marc

                  Comment

                  Working...
                  X