DataTables / Responsive

Responsive extension for DataTables, providing support for complex tables on all device screen sizes
Other
148 stars 87 forks source link

Can't Expand When Icon in Separate Column #16

Closed ComputerTinker closed 8 years ago

ComputerTinker commented 9 years ago

If I create a responsive table with:

    "responsive": true

everything works fine, however, if I replace that line with:

    "responsive": {
      "details": {
        "type": "column"
      }
    }

and add the appropriate columns to the table, then I can see the icon being displayed in the separate column, however clicking the icon does not result in the table expanding to show the hidden columns.

Here is a live example of the issue: http://jsfiddle.net/ng9ku8y9/

Any help appreciated. Thank you!

ComputerTinker commented 9 years ago

As a workaround, I can just add an extra (empty) column to my table as the first visible column, without using any special class names, keep "responsive":true, and everything works as I want it to.

DataTables commented 9 years ago

Sorry for the delay in replying. Good to hear you have a workaround at the moment.

It looks like there might be an error in how the control column is being calculated. I'll look into it when I get back to the office.

cdaringe commented 9 years ago

@ComputerTinker, would you be willing to post/edit a fiddle of your workaround? I tried editing your fiddle to match the description and it was still being stubborn

ComputerTinker commented 9 years ago

Thanks for following up. I'm totally swamped at the moment but I will try to get you that fiddle soon.

DataTables commented 8 years ago

The issue here is that Responsive will assume a target column of index 0 for the Responsive control. In this case the target column for the control is actually index 2, so we need to tell Responsive that fact: http://jsfiddle.net/ng9ku8y9/17/ .

I think this could probably be improved, so Responsive detected the control class, but for now it works, so doing to close this issue (heading for a year later... sorry!).