PDA

View Full Version : EditorGrid Get Selected Cell columnIndex



christophe.bousquet
24 Feb 2009, 1:52 AM
Hello GWT users ,
My main objective is to make a kind of column validator which checks that the total of each cell's column value don't go over a specified value, and force invalid in othercase for example.

The problem is that i can't find a way to get the selectedcell's column.
I get the row like that:


int rowIndex = store.indexOf(gridSelectionModel.getSelectedItem());
I need the column index to start my routine that check the whole column.

Anybody knows how to get that *** column index :) or is there any other way to do validation on the column?

Thanks.

jadrake75
25 Feb 2009, 1:02 PM
Are you trying to do the validation upon entering a value? ie... user enters "1000" in a number field alllowing a range of 0-100 and you want to flag it? You can set up a listener on the EditorGrid for the Events.ValidateEdit and the grid event will contain the column in question.

-Jason

christophe.bousquet
26 Feb 2009, 12:04 AM
Are you trying to do the validation upon entering a value? ie... user enters "1000" in a number field alllowing a range of 0-100 and you want to flag it? You can set up a listener on the EditorGrid for the Events.ValidateEdit and the grid event will contain the column in question.

-Jason

thx jason i just did it a few before you make that reply and it works fine.




grid.addListener(Events.AfterEdit, new Listener<GridEvent>(){
public void handleEvent(GridEvent be) {
int row =be.rowIndex;
int col = be.colIndex;