3.2.0

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
February 13,
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
February 13,
thanks Carlos
Just a smal improvement...var clickedrow = rowIndex; is not needed neither
Just replace previousRow = clickedrow; by previousRow = rowIndex;
Thanks
DD
February 22,

This topic is archived.

See also:


Back to support forum