Radio Buttons Affected By sScrollY

Radio Buttons Affected By sScrollY

essexstephessexsteph Posts: 57Questions: 0Answers: 0
edited February 2013 in General
Bit confused by this, I have some radio buttons in my table which I set a default on (using 'checked'). Using zero configuration this works as expected, but if I add

[code]
"sScrollY": "300px",
"bPaginate": false
[/code]

it doesn't!

Here's a simple test case: http://live.datatables.net/ocabay/3/edit#preview. The top of the two tables is zero configuration, the bottom adds the code above.

Any suggestions gratefully received.

Steph

Replies

  • wblakencwblakenc Posts: 77Questions: 17Answers: 1
    I have a similar issue. It seems when you do anything to the columns (i.e. using sScrollY or aoColumns) the first radio button is broken. I modified the live version you created with additional info: http://live.datatables.net/afoqef/2/edit

    It seems to cause an issue in Chrome but not IE. Strange.
  • allanallan Posts: 62,066Questions: 1Answers: 10,173 Site admin
    That's extremely odd. But I have a sinking feeling I know what it is... Yes - its the auto width calculation DataTables does.

    It takes a copy of the longest text string for each column and injects that into a temporary table which is used to perform the width calculations. That copy is an HTML string in this case and the default is being applied to the radio elements in the width sizing table...

    Disabling auto width ( bAutoWidth - http://live.datatables.net/afoqef/4/edit ) allows it to work as expected.

    That's going to be a bit of a pig to put in a workaround for - but it needs to be done. Thanks for highlighting this. I'll get a fix in for 1.10.

    Allan
  • wblakencwblakenc Posts: 77Questions: 17Answers: 1
    edited February 2013
    Thanks Allan!

    Confirmed that bAutoWidth set to false fixes this issue for me. Is there any 'harm' you can see by turning auto width off?
  • allanallan Posts: 62,066Questions: 1Answers: 10,173 Site admin
    Column widths might bounce around a bit as you page through the table. But it won't kill any functionality.

    Allan
  • essexstephessexsteph Posts: 57Questions: 0Answers: 0
    Thanks, not a problem for me to turn auto widths in my case until 1.10 is out.
This discussion has been closed.