Datatable responsive row collapse problem
Datatable responsive row collapse problem
jemz
Posts: 131Questions: 40Answers: 1
Hi, I am using Datatables responsive it works fine when the rows will not collapse.but when it collapse and clicking the "plus green icon" to show the child row. I cannot get anymore the row id.
`
$('#mytable').on( 'click', 'tr', function (e) {
var rowid = tbl.row( this ).data().id; // it will udefined when the rows collapase
}
`
Thank you in advance.
This discussion has been closed.
Answers
Hi, I'm having the same trouble.
When I try to get the row data with the row expanded, it throws me a error "undefined".
Someone find something?
I have a solution, at least it worked for me. When the DataTables is collapsed there css classes that apply when the lines open. One solution is to verify that the selected line is open or not. If you are then I attribute the nRow variable and use. Example: