jqxgrid rowselect event not triggering

329 Views Asked by At

I am trying to get the row data when the user checks the tick on the row checkbox.

$('#jqxgrid').on('rowselect', function (event) {
        var rowIndex = $('#grid').jqxGrid('getselectedrowindexes'),
            rowdata;

        rowdata = $("#grid").jqxGrid('getrowdata', rowIndex);
        selectedRows.append(rowData);
        alert("Row with bound index: " + rowIndex + " has been selected");
    });

I also tried .bind instead of .on but both are not working.

1

There are 1 best solutions below

0
Muzaffer Galata On

This one should work:

$('#jqxgrid').on('rowclick', function (event) {
    var row = event.args.rowindex;
    var datarow = $("#jqxgrid").jqxGrid('getrowdata', row);    
    alert("Row index: " + event.args.rowindex +" has been clicked.");
    //alert(datarow.first + ' ### ' + datarow.second + ' ### ' + datarow.third)
 });