Announcement

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

    clearing the values of a listGrid filterEditor

    Is it true that perhaps the only and best way to clear the filterEditor values is via a call to
    Code:
     
    listGrid.setShowFilterEditor(false); 
    listGrid.setShowFilterEditor(true);
    thereby destroying and creating the filter editor and resetting its values?

    The problem is that if I have a listGrid filterEditor, and I have entered filter criteria, it persists if I navigate away from the page and come back.

    My desire is to have the filterEditor cleared (reset) every time that the page is shown.
    Thanks!

    #2
    Calling filterData with criteria replaces the current filter editor criteria with the new criteria.

    Comment


      #3
      Calling filterData will result in a "fetch" operation, as is my understanding.

      If the data is extremely large (e.g. over 100,000 rows of data), I would prefer not to do a fetch. Therefore, all I want to do is simply clear the values without doing any hits on the datasource/database.

      Does that make sense?

      Comment


        #4
        I would think you would be using a paged fetch on a dataset that large, thus minimizing that particular issue.

        Comment


          #5
          Yes, I would be using a paged fetch on a large dataset like that.
          Even so, is there a way to clear the filter field's value without even doing a Post or any sort of fetch to the dataSource?

          Comment


            #6
            Are you trying to essentially "reset" the ListGrid, clearing the data and the criteria also? We have this case in our code, but we always fetch updated data when the ListGrid is re-shown, using empty criteria, which works great and guarantees we show up-to-date data.

            Comment


              #7
              Hi,

              Even I am facing the same kind of issue.
              Is there any way to:
              1. Clear filter and retain the filtered values in the grid.
              2. Clear filter and restore the grid without hitting the datasource.

              Presently I am using fetchdata which restores the grid by hitting the datasource.

              Comment


                #8
                @kiranv it doesn't make sense to show filtered data in the grid while the filter is empty. That would just mislead the user. If you filterData() with empty criteria, there will be no fetch if the grid has a complete cache of all records from before filtering (see ResultSet docs on filtering), otherwise there will be a fetch (and this also is correct behavior).

                Comment


                  #9
                  someone can help us, i have same problem
                  how to reset/clear filtereditor if i press button?

                  look my code
                  Code:
                  submitbtn.addClickHandler(new ClickHandler(){
                  
                  			@Override
                  			public void onClick(ClickEvent event) {
                  				// TODO Auto-generated method stub
                  				[B]listGrid.setShowFilterEditor(false);
                  				listGrid.setShowFilterEditor(true);[/B]
                  			}
                          	
                          });
                  i think listGrid have method to clear/reset value.

                  Originally posted by Isomorphic
                  @kiranv it doesn't make sense to show filtered data in the grid while the filter is empty. That would just mislead the user. If you filterData() with empty criteria, there will be no fetch if the grid has a complete cache of all records from before filtering (see ResultSet docs on filtering), otherwise there will be a fetch (and this also is correct behavior).
                  i think its not for filter but just reset/clear value.
                  Last edited by linsay; 7 Jan 2010, 19:50.

                  Comment


                    #10
                    @linsay If you don't intend to retain the data, just call setCriteria() with blank criteria.

                    Comment


                      #11
                      I was facing a similar problem that i just want to clear the filter editor on a button click. I tried the solution given in this thread i.e.
                      listGrid.setShowFilterEditor(false);
                      listGrid.setShowFilterEditor(true);

                      But after doing this I am facing a strange problem. I am having 5 columns in my grid , each clumn has an editor , when i run the above code all the columns editor are getting cleared up except the 1st column.
                      Can someone suggest as why is this happening ?

                      Comment

                      Working...
                      X