PDA

View Full Version : extjs4.0.7 infinite grid looses data while scrolling



timTaylor
20 Jul 2012, 3:53 AM
I do have an infinite Grid with {xtype: 'rownumberer',width: 50,sortable: false} at the first column.
If I scroll down, so the first row gets out of view and if I then scroll up again, the row #1 will not be shown anymore and i can't scroll up further ... ???

:((

Does anyone know a Bugfix for this?

(can't upgrade the project to ext 4.1.1)

Farish
20 Jul 2012, 5:56 AM
the row is still there; the scrollbar is somehow broken on scrolling. I had the same problem. If you click on the record which you now see on top and move up the selection using the cursor (arrow) keys, you can again see it. I struggled with it but couldnt find a solution. may be you can try something like selecting the first record:


grid.getSelectionModel().select(0);

or redoing the layout of the grid or rendering it again somehow...

scottmartin
20 Jul 2012, 7:51 AM
Scrolling in 4.07 (virtual) was a hot mess. The best solution would be to upgrade. If you simply cannot, try the option above, your you may simply have to create an override that suits your needs.

Scott.

timTaylor
20 Jul 2012, 11:45 PM
Hi there :-)

Thanks, but all actions are ignored. I've tried:



this._store.on('load',function()
{
console.log('on load',arguments);
var grid = Ext.getCmp('mygrid');
if(grid)
{
grid.invalidateScrollerOnRefresh = true;
grid.view.refresh();
grid.getSelectionModel().select(0);
}
});


but nothing helps. Strangely the LOAD event is only fired, if the scroller reaches the top (or what the scroller thinks the top may be). Seems to be a bug, because the whole infinite grid only fires kinds of PREFETCH events.
It also doesn't work if I select the 2nd record and use the up-cursor. The selection goes out of view, is still there because if I go down with the cursor, the selection is visible again. But the scroller doesn't change and the grid-view also.

Farish
21 Jul 2012, 12:51 AM
If the grid has rowediting/cellediting plugin, and then you move the selection up and press Enter to activate it, then I guess the first row would show but this wouldn't help you any way...

I discussed this at length in the Premium Forums but couldn't get it working. They suggested me to upgrade (which wasn't possible for me) or use paging (which I had to do at the end). Also, the rendering of the grid was quite slow when the number of records was increased to some thousands. It would take quite some seconds and every time the user would edit something in the grid, it would again take many seconds...

timTaylor
21 Jul 2012, 1:54 AM
Hi Farish,
these are REALLY BAD news! What arguments are left to tell a customer in such a Situation?
It seems very risky to me to use ExtJS on commercial Projects.
Do you know any method to tell the whole grid & store to refresh from 'new'?
grid.view.refresh() doesn't have any affect.

Farish
21 Jul 2012, 2:00 AM
what if you reload the store? it might work although with a lot of requests and responses sent back and forth...

if you cannot get it to work, then go for paging. thats what I did at last. how many records do you have to show at a time?

timTaylor
21 Jul 2012, 2:12 AM
I tried to reload the store at the 'LOAD' event but it ends up in an infinite prefetch-loop.
I don't really want to use paging. It should be a high quality reference Project, which shows possibilities of almost perfect data handling for the user. My paging size for now is set to 100 records.

Farish
21 Jul 2012, 2:16 AM
you shouldnt call load on load event. you should call it when the problem with the scrollbar appears but i dont know what event this would be! unfortunately, I cant help you with this.

timTaylor
21 Jul 2012, 2:20 AM
That was also my thought and I also do have no Idea, 'what' tells me that the scrollbar is 'on top' :-)
Thank you anyway for trying me to help!
In between I took a look at sencha's example of the infinite grid (4.0.7) and it comes up with the same error.
:((

timTaylor
21 Jul 2012, 2:28 AM
FIXED!!!!!!!!!!!!!!!!!! \:D/\:D/\:D/




this._store.on('load',function()
{
//console.log('on load',arguments);
var grid = Ext.getCmp('mygrid');
if(grid)
{
grid.view.scrollByDelta(-1000);
}
});


found the scrollByDelta function by playing around ...
Now, even if I scroll to record 400 und then up, the grid starts with record #1

Farish
21 Jul 2012, 5:03 AM
thats great! will help some one else in the future :)

timTaylor
21 Jul 2012, 11:19 AM
I hope so!

ju187
28 Jan 2013, 11:00 PM
Found this after search as I have the same issue. I think you mean scrollByDeltaY. BTW, why 1000? Thanks.