Selected Row Index of a selected row in a Datatable
Selected Row Index of a selected row in a Datatable
austinjacob
Posts: 2Questions: 0Answers: 0
Hi,
I need to get the selected rowindex of a paginated data table. The problem is when I refresh the datatable using ajax. I am getting some random number as selected row index or row number. But for the first time I am getting correct row index.
Currently I am using the following line of code to get the selected row index under fnRowSelected function of tabletools
[code]
var oTable1 = $('#exampleTable').dataTable();
var oSettings1 = oTable1.fnSettings();
var iCurrentPage1 = Math.ceil(oSettings1._iDisplayStart / oSettings1._iDisplayLength) + 1;
selectedRowIndex1=$(node).closest('tr')[0].sectionRowIndex+(iCurrentPage1-1)*oSettings1._iDisplayLength;
[/code]
Kindly let me know a solution for this.
Thanks in Advance...!!!
I need to get the selected rowindex of a paginated data table. The problem is when I refresh the datatable using ajax. I am getting some random number as selected row index or row number. But for the first time I am getting correct row index.
Currently I am using the following line of code to get the selected row index under fnRowSelected function of tabletools
[code]
var oTable1 = $('#exampleTable').dataTable();
var oSettings1 = oTable1.fnSettings();
var iCurrentPage1 = Math.ceil(oSettings1._iDisplayStart / oSettings1._iDisplayLength) + 1;
selectedRowIndex1=$(node).closest('tr')[0].sectionRowIndex+(iCurrentPage1-1)*oSettings1._iDisplayLength;
[/code]
Kindly let me know a solution for this.
Thanks in Advance...!!!
This discussion has been closed.
Replies
Allan
Thanks for your response. I am getting Row Id Properly.
But When the Child Table load repeatedly, I am getting an Object Not Found Error When I select some rows. But this error is not happening, when the child datatable loads for the first time.
Thanks
Austin