View Full Version : [CLOSED] [1.2.3] Possible Bug with EditorGrid + SelectionChangedListener

24 Mar 2009, 5:44 AM

I am using GXT 1.2.3 + Safari browser (Mac).

Well, The SelectionChangedListener is not being called when I select an entry in the grid.

For testing it, just change the EditorGrid example a little bit, this lines are enough:

grid.getSelectionModel().addSelectionChangedListener(new SelectionChangedListener<Plant>() {
public void selectionChanged(SelectionChangedEvent<Plant> se) {
MessageBox.alert("", "I was called", null);

I guess this is a bug... the MessgeBox should be displayed when I select an entry in the grid (when I click over a cell).

Thanks for checking,

30 Mar 2009, 3:33 AM

Were everyone able to recreate this? Or is there something I am forgetting to do?

2 Apr 2009, 8:40 AM

Just to add new information....
I was able to recreate this problem in FF3, IE6 and IE7 as well...
It seems that the combination EditorGrid + SelectionChangedListener is somehow broken...

I wonder if nobody else is using this combination...

2 Apr 2009, 9:01 AM
Please read the bugforum guidelines. You need to provide a fully working testcase and not only a codesnippet.

2 Apr 2009, 10:29 AM
Understood now what you mean. CellSelectionModel is working differently here as you dont select a complete ModelData.

There are no events fired.

2 Apr 2009, 11:56 PM
Interesting.... and this is the desired behavior?
I mean, I would guess the event still should be fired... since we selecting an entry in the grid...

Imagine that I have one button that deselect a previously selected cell in the grid...
And I want to listen to this... I don't think there is no other way of listening to this except for this event that is not being fired...

Do you have plans on changing this?
If not, do you have a workaround?


3 Apr 2009, 1:44 AM
CellSelectionModel is quite basic. You can switch die RowSelectionModel and the events will fire.

3 Apr 2009, 2:13 AM
allright, tks I will try that...

Can you tell me how to change the EditorGrid selection mode to Row?

I tried to perform this, but it was still selecting one cell:

editorGrid.setSelectionModel(new GridSelectionModel<BaseModel>());

Am I missing something?

Vielen Dank.

9 Apr 2009, 12:52 AM

really funny behavior:

If you have clicks to edit = 2 in the GridEditor.
And you set the selectionModel to

GridSelectionModel<BaseModel> rowSelectionModel = new GridSelectionModel<BaseModel>();

Then nothing happens when you click! The row does NOT gets selected.
You need to do a 2 click so then the row gets selected....

Please check this!

For a source code for testing:
You have the editorgrid example code, right?
Simply change its selectionModel and set click to edit to 2... and that is it... you have then an example to test in your hands.

9 Apr 2009, 3:14 AM
Fixed in SVN.

9 Apr 2009, 3:32 AM
Hi Sven.

Tks a lot for verifying this!

Mit freundlichen Grüßen/Best regards