1

I have to show around more than 10,000 records in a listgrid. My code is working fine but I am facing performance issue it takes too much time for it. I want to apply pagination in Listgrid, so I can increase my listgrid performance. I find the following method documentation mentioned about paging but I was not able to apply it. Can any one please explain how can I use this method??

protected void transformResponse(DSResponse response,
                                 DSRequest request, Object data)

http://www.smartclient.com/smartgwt/javadoc/com/smartgwt/client/data/DataSource.html#transformResponse%28com.smartgwt.client.data.DSResponse,%20com.smartgwt.client.data.DSRequest,%20java.lang.Object%29

RAS
  • 8,100
  • 16
  • 64
  • 86
Dhruva
  • 185
  • 1
  • 3
  • 15
  • 1
    It is kind of hard to answer without knowing how you populate your listgrid. In `DSRequest`, methods 'setStartRow()` and 'setEndRow()` are used to fetch the appropriate records. In `DSResponse`, you find the same methods and also 'setTotalRows()` to tell the listgrid which part of the results you fetched. Using these methods depends on how you fetch your data for the listgrid. – Eric C. Jul 17 '12 at 14:05
  • @EricC.I set the list in the datasource,then set the datasource in the Listgrid. datasource.setdata(list) then set the listgrid.setdatasource(datasource) ; I have made all 10,000 records then i am setting in the listgrid .I want that as i make the some records 100 or 200 then i show it in the listgrid and in background the records are generating. – Dhruva Jul 18 '12 at 04:27
  • 1
    Depends on how your server fetch is built but you may just have to use `listgrid.setDataFetchMode(FetchMode.PAGED)` and `listgrid.setDataPageSize(100);` – Eric C. Jul 19 '12 at 10:22
  • 1
    @Dhruva, I recommend going through this link (http://stackoverflow.com/questions/9468486/support-of-pagination-in-smartgwt-for-listgrid) once. & also this one: http://stackoverflow.com/questions/9799090/why-smartgwt-does-not-have-paginated-grid – RAS Jul 19 '12 at 10:54
  • @EricC. I have already done this it helps to load the object as we scrolldown the listgrid but my need is pagination as the requirement told. dataSource.setResultBatchSize(50); grid.setDataFetchMode(FetchMode.PAGED); grid.setAutoFitData(Autofit.VERTICAL); grid.setShowAllRecords(false); grid.setDataPageSize(50); grid.setAutoFetchData(Boolean.TRUE); Thanks for ur suggestions – Dhruva Jul 19 '12 at 11:49
  • Ah, what you call pagination is management of data with tabs (ex: tab1 contains 50rows then tab2 another 50 and so on...). This is not implemented in smartgwt but take a look at @RAS links. – Eric C. Jul 19 '12 at 12:20

1 Answers1

-1

By using pagination for listgrid you manually prepare pagination bar and put some controls onclick that controls the listgrid load the data. I am trying it's working and we are sure we increase grid performance.

danmullen
  • 2,556
  • 3
  • 20
  • 28