Bug: Row is selected when I open the detail row: Using Responsive with TableTools

Bug: Row is selected when I open the detail row: Using Responsive with TableTools

andythomas501andythomas501 Posts: 4Questions: 3Answers: 0
edited August 2014 in Free community support

Hi, I'm trying out the new Responsive plugin - it looks really good!
When I try to add it to a table that uses TableTools (specifically, the multi-select) - whenever I click on the "+" to expand the detail row, it also selects the row, which is really not what I want expect to happen.
Is there any way to use them together, that will allow my users to open up the detail row without selecting that row? I thought about trying to bind a "return false" to clicking on the "+" expander, but it's added using the :before psuedo-attribute, so it's inaccessible to jQuery...

Also, I couldn't get the Responsive plugin to work on the live.datatables.net site...

Answers

  • allanallan Posts: 63,522Questions: 1Answers: 10,473 Site admin

    Thanks for pointing that out - I'll take a look into it. It should be that TableTools will check that the row is a parent DataTable table row before doing anything, but perhaps that is broken...

    Allan

  • allanallan Posts: 63,522Questions: 1Answers: 10,473 Site admin

    Hi,

    Sorry for the delay in looking into this. I've just being doing so, and realised I had mistaken the issue with my comment above - it can be safely ignored!

    The error you indicate can be seen in the example here: http://editor.datatables.net/examples/simple/responsive.html . Simply make the window small enough to show the Responsive control and then the row is selected as the control is toggled.

    I could easily put in a e.stopPropagation() call into Responsive's click handler, but falls into the trap that the rest of the cell should be clickable to select the row.

    It is possible to use the TableTools sRowSelector option to disable click to select for the first column, but that also isn't ideal.

    I think the proper fix is going to be dynamically inserting elements into the table rather than using the ::before pseudo class. That would let me use e.stopPropagation() and it would also let Responsive be navigable by keyboard, which it currently isn't and is a separate issue (although this one solution will handle both).

    Going to wrap up the current release for Responsive at the moment, and then look into adding this feature as it will likely need a v1.1 update.

    Allan

This discussion has been closed.