PDA

View Full Version : [FIXED] [GXT 2.0-M2] Grid Sort doesn't work correctly



JensHeyer
24 May 2009, 9:33 AM
Hello,

I've just mentioned that the column sort option doesn't work correct in the current release. If you click on the header of a column and then switch to another one the sort icon and header color still remains in the previous state. In some cases a sort won't be executed either.

sven
24 May 2009, 9:35 AM
Yes we know. Thanks for reporting. I already have a fix ready.

sven
24 May 2009, 9:36 AM
Only the UI doesnt get updated. The sorting actions work fine.

mcosta
25 May 2009, 8:18 AM
Is this related to a exception on grid header mouseover (GridEvent.getRowIndex asking for non-existent DOM parent)?



[ERROR] Uncaught exception escaped
com.google.gwt.core.client.JavaScriptException: (NS_ERROR_DOM_INDEX_SIZE_ERR): Index or size is negative or greater than the allowed amount
code: 1
INDEX_SIZE_ERR: 1
DOMSTRING_SIZE_ERR: 2
HIERARCHY_REQUEST_ERR: 3
WRONG_DOCUMENT_ERR: 4
INVALID_CHARACTER_ERR: 5
NO_DATA_ALLOWED_ERR: 6
NO_MODIFICATION_ALLOWED_ERR: 7
NOT_FOUND_ERR: 8
NOT_SUPPORTED_ERR: 9
INUSE_ATTRIBUTE_ERR: 10
INVALID_STATE_ERR: 11
SYNTAX_ERR: 12
INVALID_MODIFICATION_ERR: 13
NAMESPACE_ERR: 14
INVALID_ACCESS_ERR: 15
result: 2152923137
filename: jar:file:/home/mati/.eclipse/org.eclipse.platform_3.4.0_1473617060/plugins/com.google.gwt.eclipse.sdkbundle.linux_1.6.4.v200904062334/gwt-linux-1.6.4/gwt-user.jar!/com/google/gwt/dom/client/NodeList.java
lineNumber: 44
columnNumber: 0
inner: null
data: null
at com.google.gwt.dom.client.NodeList$.getItem$(Native Method)
at com.extjs.gxt.ui.client.widget.grid.GridView.getRow(GridView.java:378)
at com.extjs.gxt.ui.client.widget.grid.GridView.handleComponentEvent(GridView.java:1049)
at com.extjs.gxt.ui.client.widget.grid.Grid.onComponentEvent(Grid.java:376)
at com.extjs.gxt.ui.client.widget.Component.onBrowserEvent(Component.java:756)
at com.google.gwt.user.client.DOM.dispatchEventImpl(DOM.java:1320)
at com.google.gwt.user.client.DOM.dispatchEventAndCatch(DOM.java:1299)
at com.google.gwt.user.client.DOM.dispatchEvent(DOM.java:1262)
Should I open a new thread?

micgala
25 May 2009, 11:31 PM
I am getting the EXACT same problem -Index or size is negative or greater than the allowed amount - in all of my grids...

Is it related to this?

sven
26 May 2009, 12:59 AM
Can you please explain how to reproduce that?

micgala
26 May 2009, 1:12 AM
hmm... I haven't time for trying to create a test case right now, but this is how I get that problem:

If I have a grid, and then try to put the mouse in the grid headers, then I get that problem.
Also, when I try to edit any cell, I get that problem.
Also, if My grid has 2 rows, and I try to move my mouse below the last row (where a possible third row would be) I also have that problem....

This is how I can recreate this....

If I have more time today, I will try preparing a test case.

PS: Only happens in FF (Web mode).

Regards,
Michel.

sven
26 May 2009, 1:16 AM
I dont get that. This is on FF Linux right?

mcosta
26 May 2009, 1:17 AM
It is happening in my local copy of 2.0-m2 but not in

http://extjs.com/examples-dev/explorer.html#basicgrid

nor 2.0-m1

To reproduce it you just had to mouse over the headers. GridEvent.getRowIndex was asking for a non-existant parent td.x-grid3-cell. This returned null, trying to guess the row index resulting in -1, an exception jumps in and the active state style keeps applied

So this seems solved.

sven
26 May 2009, 1:24 AM
The version on the Web is a newer build than the download. So if you dont get any exceptions there, it looks fixed.

micgala
26 May 2009, 1:26 AM
I don't have the exception in the showcase as well.

And the error appears on both FF Windows and Mac.

Colin Alworth
26 May 2009, 8:10 AM
This bug was present for a while in 1.2 I think - it is possible that this is entirely a GWT bug? NodeList.getItem claims to return null for invalid indicies, yet at least in FF, it never does...

MrExt
4 Jun 2009, 5:17 AM
The version on the Web is a newer build than the download. So if you dont get any exceptions there, it looks fixed.

I'm getting NS_ERROR_DOM_INDEX_SIZE_ERR grid header error with trunk with FF3 in WinXP and Vista

sven
4 Jun 2009, 5:19 AM
This is already fixed in SVN

MrExt
4 Jun 2009, 5:29 AM
I will confirm it with today revision, sorry. I've been checking this issue during several days. I think that with yesterday revision (last days trunk doesn't compile) the error was present.

MrExt
4 Jun 2009, 8:13 AM
I get the error with r1504 too.
Maybe it is caused by our code. We are using RPC and cancelling in some cases the load events... Any suggestions?

I'll try to submit a testcase if posible (in a new thread- I did not want to duplicate this one).
Thanks

Colin Alworth
4 Jun 2009, 9:29 AM
Also still seeing the issue in r1504 with our own use of the grid, though not with the example code. I havent stripped the grid code out to see what change does it yet, but so far I can say that it happens with both Grid and EditorGrid. I'll try to build a small example that still demonstrates the issue.

Running FF on Win XP - seems not happen on either IE or Safari...

I don't know a lot about the inner workings of the Grid, but this appears to be a GWT issue with the NodeList. If I replace GridView.getRow with

public Element getRow(int row) {
if (row < 0) {
//GWT.log("GridView.getRow called on invalid row", null);
return null;
}
return getRows().getItem(row);
}the bug doesn't happen.


In GWT, NodeList.getItem(int) javadoc insists that it will return null on an invalid index, but this appears to not be the case in FF.

sven
4 Jun 2009, 9:34 AM
Thanks for the research. I found out almost the same as you and i am going to change that method.

MrExt
5 Jun 2009, 1:16 AM
I don't know a lot about the inner workings of the Grid, but this appears to be a GWT issue with the NodeList. If I replace GridView.getRow with

public Element getRow(int row) {
if (row < 0) {
//GWT.log("GridView.getRow called on invalid row", null);
return null;
}
return getRows().getItem(row);
}the bug doesn't happen.


In GWT, NodeList.getItem(int) javadoc insists that it will return null on an invalid index, but this appears to not be the case in FF.

Thanks Colin, I apply this change and the exception is gone.

sven
5 Jun 2009, 6:05 AM
Fixed in SVN.