Is it possible to select cells in children rows?
Is it possible to select cells in children rows?
I am restricting the cells a user can select to certain columns using selector: 'td:nth-child(n+6):nth-child(-n+11)'
When I expand the children of a row (which has the same format/columns), how can I allow the user to select the cells in those children rows? I would like to apply the same selection restrictions as the parent. I've tried resetting the select.selector on the table and a few other off-the-wall ideas but nothing seems to work. Is this possible?
This question has an accepted answers - jump to answer
Answers
I presume you are using the Select extension? If so, then no. It will intentionally find and disallow selection of elements which are not part of the host table.
If you wanted to select items in the child row you would need to write some code for that.
Allan
Ok. Thanks for the quick reply Allan. :)
@allan - I have a feature on my web app where people can view the active sessions associated to their account, and the activity in the session. I use the Child Rows Example, except for the format function loads a table with a unique ID, which has its rows populated via AJAX, then a new DataTables instance is initiated for that table.
I should be able to use the select extension for that right? The DataTables works perfectly find on the table in the child (Well, it did, something recently broke, or else id just try to add
select: true
to the DT child rows initiation.Heres the relevant code
Also, as you can see, the session table is re-populated every time the row is expanded, so if you wanted to see new data, you would have to close it then expand it. Would you suggest that I use a different method for doing this?
Nevermind, got it to work!
http://d.pr/i/LAZl
http://d.pr/i/B7P2
@jfincanon is that anything like what you need?