View Full Version : 1.1b2 GridView in ContentPanel

11 Jul 2007, 12:57 AM
This one is a bit long, I'll try and make it succinct, I would make up a demo but I don't really have time.

Version: 1.1b2
Adapter: Ext base
OS: Windows
Browser: IE7

1) There are a series of links in a west panel. Clicking on an link in the west panel loads a CP in the center panel.
2) Each center panel contains a bunch of content, including a grid (nb: not using a GridPanel, but a CP). The grid works correctly and everything is fine up until this point.
3) If the user clicks the links in the left in quick succession (say 3 in 1 second) Ext throws an exception. A list of the exceptions is below, and what I did to stop them occurring.

First exception:
Method - Ext.grid.GridView.updateSplitters
Error - s[i].style is null or not an object
Fix -
if (s[i]) s[i].style.left = (pos-this.splitOffset) + "px";

Once this was solved, there is now
Second exception:
Method - Ext.grid.GridView.updateHeaderSortState
Error - hds.item is null or not an object
Fix -
if (hds.item == 'object') hds.item(sortColumn).addClass(sc[sortDir == "DESC" ? 1 : 0]);

Once this was solved, there is now
Third exception:
Methd - Ext.grid.GridView.scrollToTop
Error - An unknown exception occurred
Fix -

this.scroller.dom.scrollTop = 0;

I realise this might be a bit vague, but these might be nice sanity checks to have on the GridView (and it appears to resolve the issue).

11 Jul 2007, 10:13 AM
sorry to sound repetitive, but have you tried this with 1.1 RC1?

11 Jul 2007, 3:42 PM
Tried in RC1, same issue applies.

Basically I think what's happening is that the grid is still initialising when the dom has already disappeared.

12 Jul 2007, 3:03 PM

12 Jul 2007, 4:32 PM
There's is nothing Ext can do about rapid clicks of links, the grid and other components have no way of knowing about this stuff. What you will need to do is buffer the clicks (it's what I do in the FeedViewer and other examples). This way, if the user clicks rapidly, only the last click is used.