Announcement

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

    ListGrid server-side sorting filtering

    Hi there,

    i'm getting frustrated. Since two days i try to develop a server-side ListGrid. Since DataSource couldn't handle larger dataset (>10000 rows) with clientOnlyMode - at least with bad performance.

    I don't understand how to reload while i'm scrolling to the bottom of the listgrid and also using the feauters like filtering and sorting.

    What would be the best practices pattern for large datasets where i have the need sorting and filter?

    Thanks a lot!
    Philippe

    #2
    Have you read the QuickStart Guide, specifically the Data Integration chapter? It explains the entire expected interaction and links to further details (ResultSet docs, etc).

    Comment


      #3
      Thanks for the tip. I didn't read it before. But i did read javadoc a lot.

      Finally i made it working. By rebuilding my Code step by step. Therefore i extended the DataSource Class and also overloaded the transformResponse method. So i wired my own query together with getStartRow/endRow. To fetch by scrolling i set up the ttlRows in DSResponse. Now it works like i wanted.

      But somehow the event addFilterEditorSubmitHandler doesn't fire in productive mode. Any Ideas?
      With empty criteria it fires; with some criteria it just fires invalidateCache but doesn't fetch Data. The fetch just comes with test-mode not in productive. I also tried to start countryGrid.fetchData() explicit, no result. Here's my overloaded event:
      Code:
      	  countryGrid.addFilterEditorSubmitHandler(new FilterEditorSubmitHandler(){
      
      		@Override
      		public void onFilterEditorSubmit(FilterEditorSubmitEvent event) {
      			// TODO Auto-generated method stub
      			countryGrid.invalidateCache();
      
      		}
      		  
      	  });
      Any Ideas why?

      Comment


        #4
        It doesn't make any sense to call invalidateCache() in that method. What were you hoping that that would do?

        Comment


          #5
          Ok, i read this method clears listgrids data and forces a new fetch.

          This behavior is what i want to see. When user sorts or changes criteria, listgrid should remove all cached data and automatically fetch a complete new data from server. On Server i wire up my DB-Query by my own.

          Is there a different approach to fetch a new dataset after changing criteria?

          Comment


            #6
            Yes, read the docs for fetchData().

            Comment


              #7
              I'm using autoFetchData=true. I uncomment this and instead i'm using fetchData(Criteria criteria, DSCallback callback). In JavaDoc i read that ResultSet will fulfill my needs. Is ResultSet the right way? Can you show me how to connect a ResultSet to ListGrid? Or were does it have to be connected with?

              Am I right by setting the ResultSet with the following properties?:
              'useClientSorting'=false
              'useClientFiltering'=false?

              Thanks for your help!

              Comment


                #8
                Did you read the docs for fetchData()? It already explains all of this, and if you need any more details, click through to the docs for ResultSet. If that's confusing, go back to the QuickStart Guide's chapter on Data Integration.

                No, in general you don't want to turn off client-side filtering or sorting, because that would have worse performance. The default settings are the ones you should generally use.

                Comment


                  #9
                  Hi, I am also using RestDataSource and I want the client to handle all sorting functionalities, but every time I try to sort the ListGrid ascending or descending, it will make a call to the Server and ask for the data. I also read in the QuickStart Guide that to let that happen, we need to return back a DSResponse containing only the data in any order which it does that, but no sorting happens on the client side.

                  Comment


                    #10
                    As is already covered in the docs and samples, there will be a server-side sort if the data returned is incomplete, because there's no other way to do it. If the data returned is complete, there will be a client-side sort. This happens automatically. If you think something is actually wrong in the framework, start a *new thread* (do not hijack an existing thread again) and post a minimal, ready-to-run test case showing how the problem can be reproduced.

                    Comment

                    Working...
                    X