ParamQuery grid support forum
General Category => Help for ParamQuery Pro => Topic started by: RedBully on November 03, 2014, 11:08:47 pm
-
Hello,
I'm using paramgrid with header filtering. I'm using rowDblClick and I need to identify the row that has been double clicked.
I initialise my grid with:
rowDblClick: function (event, ui) { handleDoubleClick(event, this, ui); },
and I have
handleDoubleClick = function(event, grid, ui) {
var rowIndx = ui.rowIndx;
//Do something with this row Index
}
This works fine until I filter the list using header filtering.
If the list is filtered, then the rowIndx is the index of the row with respect to the filtered data
e.g. If I have data with 10 rows and then filter so that only rows 7 and 8 are shown, rowIndx for the first row is 0 instead of 7 as expected
I need the index of the row with respect to the data, not with respect to the filtered data set.
I can get ui.rowData but this just gives me the data from the row and not the index of the row.
Is it possible to get the index of the row with respect to the data?
Thanks in advance
-
I have worked around this problem by comparing ui.rowData with every row in my original data array in order to determine the row data index. This works ok
var realRowIndex = ui.rowIndx;
for (var r = 0; r < data.length; r++) {
if (data[r] == ui.rowData) {
realRowIndex = r;
break;
}
}
//Use the real row index
ui.rowIndx = realRowIndex;
//Continue as normal