Radio button checked problem

Radio button checked problem

CrazyYannCrazyYann Posts: 9Questions: 1Answers: 0

Hey,

i use DataTables 1.10.2 and jQuery 1.9.1.

As you can see on this page on the first line (Titi) the radio button of the "Yes" column still uncheck than in my code the value of the checked attribute is "checked".

I have this problem only on the first line.

Could you help me?

Thanks a lot.

Replies

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

    Add autoWidth: false to your table initialisation to fix it.

    It is somewhat convoluted, and this exact thing had me scratching my head not that long ago, but what is happening is that DataTables, when trying to find the "worst case" table for the auto column widths, is copying the HTML and injecting it into the DOM. That means that there are two radio buttons with the same name and value, with the newest 'checked' one being checked. That removed the checking from your own!

    I think I might have to put some special code into DataTables to stop this from happening as it is rather annoying...

    Allan

  • CrazyYannCrazyYann Posts: 9Questions: 1Answers: 0

    Thanks Allan!

  • CrazyYannCrazyYann Posts: 9Questions: 1Answers: 0

    How to close the discussion?

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

    Discussions don't get closed (at least not until the auto close happens in about 6 months :-) ).

    Allan

This discussion has been closed.