:: Forum >>

onCurrentSelectedRow event

Hi

I did not find an event "onCurrentSelectedRow" or something like this, when the current selected row is selected again.
I am using a "single-row" mode.

I did as following
var previousRow = '';

grid.onSelectedRowsChanged = function(rowIndicesArray){
Row = rowIndicesArray;
Id_player_account = grid.getCellValue(3,rowIndicesArray);
label.setControlText("rows: [" + Row + ", " + Id_player_account + "]");
}

grid.onRowClicked = function(event, rowIndex){
if ( previousRow == this.getRowPosition(rowIndex))
{
alert(this.getRowPosition(rowIndex));
}
previousRow = this.getRowPosition(rowIndex);

Is there a better way to do so?? what do you think guys??
DD
Saturday, February 13, 2010
You do not need to use the row position at all, or it'll fail after sort.
(i.e select a row - sort - click on the same selected row)
Try this way:
var previousRow = '';
grid.onSelectedRowsChanged = function(rowIndicesArray){
Row = rowIndicesArray[0];
Id_player_account = grid.getCellValue(3,rowIndicesArray[0]);
label.setControlText("rows: [" + Row + ", " + Id_player_account + "]");
}

grid.obj.onRowClicked = function(event, rowIndex){
var clickedrow = rowIndex;
if ( previousRow == rowIndex)
{
alert(rowIndex);
}
previousRow = clickedrow;
}

HTH
Carlos
Saturday, February 13, 2010
thanks Carlos
Just a smal improvement...var clickedrow = rowIndex; is not needed neither
Just replace previousRow = clickedrow; by previousRow = rowIndex;
Thanks
DD
Monday, February 22, 2010

This topic is archived.


Back to support forum

Forum search