Show details automatically for some selected rows
Show details automatically for some selected rows
zx81
Posts: 9Questions: 2Answers: 0
Would it be possible to show the additional details row automatically for some rows based on a specified condition ?
Alternatively I would not mind creating a javascript function that displays the detail of a particular row but I could not figure it out.
This discussion has been closed.
Replies
You can loop all the rows using
rows().every()
. In the loop you can check for your condition then userow().child().show()
to show the child. You can do this ininitComplete
ordraw
or whatever event suites your purpose.Kevin
Thanks. I still can't figure out the exact line to lets's say show the detail row of the first row
I tried $('#myTable').DataTable().row(0).child.show() among many other things.
Here is an example of what I described to open rows base on a condition. In this case Office === London:
http://live.datatables.net/toqedesi/1/edit
In order for
row().child.show()
you need to attach the child row first usingrow().child()
to apply the row data. Did you do that?If you still need help please update my test case or create you own with what you need help with.
Kevin
Fantastic! Thanks a lot Kevin. Much appreciated.