WijGrid get selected row after filtering

971 views Asked by At

In my page i have a WijGrid with showFilter set to true. In the script section I have the following code:

$("#wijGrid").dblclick(function (e) {
    var index = $("#wijGrid").wijgrid("currentCell").row().dataRowIndex;
    var data = $("#wijGrid").wijgrid("data");
    var row = data[index];
    //Do some stuff here..
});

This function fills var row with the row selected in the grid. But when an filter is active, the row is filled with the wrong datarow. It looks like the rows in data is the original data without the filter applied. Is there a way to get the correct row if the grid is filtered?

Thanks in advance, Arvid

1

There are 1 answers

1
Ashish On

You can get correct row after filtering using the "dataView" option like this:

var index = $("#demo").wijgrid("currentCell").row().dataRowIndex;
var data = $("#demo").wijgrid("dataView");
var row = data.item(index);
//Do some stuff here..