Scenario A: Show 800.000 records, paginated but without progressive loading:
The server sends back a response like this:
I'm using the getVisibleRows() and getTotalRows() methods inside a dataChanged() event to show the visible and total number of records. It all works fine, until I noticed the warning in the browser's Developer Tools. So I'm trying to build...
Scenario B: Show 800.000 records, paginated but with progressive loading:
The server first counts the number of rows. If it is less than 200.000 (which isn't the case in this example), it returns a response like the one from scenario A. If it is more than 200.000, it sends back this response:
I don't know how to access that "myCustomRowCount" property inside the grid's dataChanged() event.
Beware: this is what I had before I started looking into that SmartClient 14 API, which was after your post hinted me into that direction. It looks promising, so what I did was replace the SmartClient code to version 14 and changed the response only at two places:
That's when I stopped my endeavor and write you this post. To conclude it positively, I would like to know if it is possible to use the "myCustomRowCount" property inside the grid's dataChanged() event. The only way I can think of to be able to access it, is by inheriting the transformResponse() method of the data source, check the component ID that invoked the request and if that's a grid, set a property on the grid with that value. This seems to be doable, but is not favorable because my data sources are generated taking user grants into account and I don't need that code everywhere, only in this particular grid. Therefore, I would prefer doing something special in this particular grid.
Hope this all makes sense...
The server sends back a response like this:
Code:
{ "response": { "status": 0, "data": [....], "endRow": 79, "startRow": 0, "totalRows": 800000 } }
Scenario B: Show 800.000 records, paginated but with progressive loading:
The server first counts the number of rows. If it is less than 200.000 (which isn't the case in this example), it returns a response like the one from scenario A. If it is more than 200.000, it sends back this response:
Code:
{ "response": { "status": 0, "data": [....], "endRow": 79, "startRow": 0, "totalRows": 99, "myCustomRowCount": 800000 } }
Beware: this is what I had before I started looking into that SmartClient 14 API, which was after your post hinted me into that direction. It looks promising, so what I did was replace the SmartClient code to version 14 and changed the response only at two places:
- renamed "myCustomRowCount" to "estimatedTotalRows"
- added "progressiveLoading" with value true
That's when I stopped my endeavor and write you this post. To conclude it positively, I would like to know if it is possible to use the "myCustomRowCount" property inside the grid's dataChanged() event. The only way I can think of to be able to access it, is by inheriting the transformResponse() method of the data source, check the component ID that invoked the request and if that's a grid, set a property on the grid with that value. This seems to be doable, but is not favorable because my data sources are generated taking user grants into account and I don't need that code everywhere, only in this particular grid. Therefore, I would prefer doing something special in this particular grid.
Hope this all makes sense...
Comment