DataTables / Responsive

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

Initial load doesn't apply correct column widths #56

Closed Tklaversma closed 8 years ago

Tklaversma commented 8 years ago

Hi Allen,

When DataTables is loaded it's show the table with incorrect column widths (see here). When I resize the browser window, it's automatically show the correct widths (see here).

Since I updated my DataTables to 1.10.10, Responsive to 2.0.0 and Buttons to 1.1.0 this is happening..

Hope you can help me out.

Regards, TK

DataTables commented 8 years ago

Can you link to a test page showing the issue so I can try to debug what is happening please.

Tklaversma commented 8 years ago

@DataTables Here you can find a fully working example. I used the Download builder to create the debug version of the version I'm using. In jsFiddle you can find the libraries on the left panel under "External Resources".

Note that before I updated my DataTables to 1.10.10, Responsive to 2.0.0 and Buttons to 1.1.0, the buttons were as close to eachother as after the window resize. So personally I think Responsive "forgets" to (re)calculate column widths onload or something..

Thanks for helping me out!

DataTables commented 8 years ago

Thanks for the link. I'll take a look into it as soon as I can.

Tklaversma commented 8 years ago

@DataTables Thanks for taking a look at it. I'll await your response.

DataTables commented 8 years ago

The issue is related to the use of the never class - that is really legacy now and should no longer be used in v2.

Add the following the DataTables columns initialisation and it helps:

                {
                    targets : 'never',
                    visible: false
                }

It isn't quite right, but I'll continue to look into it.

Tklaversma commented 8 years ago

Thanks for letting me know. I'll update my code to not use never anymore. But what is the new way of using it? Your example or is that a workaround?

DataTables commented 8 years ago

Use the DataTables column visibility controls - the never class was always a workaround.

However, it looks like there is still an error, when Responsive is required on load.

Tklaversma commented 8 years ago

Ah ok. Thank you for showing me the correct way of using "never" (or what ever I want to call it :P). Good luck with fixing the error in Responsive.

Greetings!

DataTables commented 8 years ago

Going to reopen so I remember to fix this... :-)

DataTables commented 8 years ago

Closing again as a result of the fix for #66.