View Full Version : Grid panel result display

26 May 2014, 11:43 PM

I have a Ext.grid.Panel implementation here which works fine except for the first store request in chrome.
Whenever I first load the grid in chrome and make a first "search" request, the amount of rows shown is not correct. The pagingtoolbar on the bottom shows for example "1 - 20 of 260", but only 17 rows are displayed.
When I re-execute the search or hit refresh, 20 rows are displayed.
What I am looking for is either a hint or solution to where the problem may be situated or the ext code that is responsible for displaying the rows (so I can debug).


27 May 2014, 6:13 AM
How many records are actually returned from the store, and what is the totalRecords value?

The toolbar calculates the page totals, the grid shows the actual records:

{ total : 100, data: { 10 records } } should show 1 - 10 of 100 (pageSize: 10)

27 May 2014, 9:57 PM
The totalrecord count is 260 and there are actually 20 records returned (pagesize is also 20).
I just debugged through the collectData and prepareData methods of Ext.view.Table and this confirms it.
The collectData method retrieves 20 records and the prepareData method is called 20 times (once for each record). When I check the attached store, it has a totalRecordCount of 260 and the pagesize is set to 20.
So this is all looking good and adds up.
When I continue processing, the actual view is build up on screen and I see only 17 records (rows) displayed.
The toolbar says 1 - 20 of 260.
When I now re-execute the same action or hit refresh, the actual 20 records (rows) are displayed.
This also only happen in chrome, not in any other browser, so far as I can see.

I have been doing some further investigation and seems that all records are present, but the height of the grid is calculated wrong. So the missing records are hidden behind the pagingtoolbar and the bottom of the grid. This fails the first time the grid loads in chrom eand firefox, not in IE.
Any idea?

28 May 2014, 4:09 AM
What do you see when you compare your initial return json with your refresh return json?

Do you have any filters set on your initial load?

2 Jun 2014, 12:40 AM
See the EDIT in the op.
There is no problem with the store or the data, it has to do with the layout.
When the page is loaded and I open de debug console end trigger doLayout() on my panel, the panel is displayed correctly with the missing records.
The problem is that no matter where I plug this doLayout() in my code (afterrender, viewready, load, etc.), the result is not the same as calling doLayout from the debug console.

2 Jun 2014, 7:12 AM
We would need to see some code. There should be no reason to issue a doLayout in this case.