Table with radio buttons - first row un-checked

Table with radio buttons - first row un-checked

logartlogart Posts: 2Questions: 0Answers: 0
edited February 2013 in Bug reports
Here is the fiddle:

http://jsfiddle.net/HhQpF/

If you disable dataTables, all the rows have a default radio checked. Enabling dataTables, and the first row is un-checked.

Any ideas?

Replies

  • essexstephessexsteph Posts: 57Questions: 0Answers: 0
    I think this is the issue is discussed here:

    http://datatables.net/forums/discussion/14180

    Steph
  • logartlogart Posts: 2Questions: 0Answers: 0
    Steph,

    It is a similar issue but I am having this problem with zero-config.

    By adding [code]"bAutoWidth": false[/code] it does resolve my issue. Should I report this as a bug?
  • allanallan Posts: 63,498Questions: 1Answers: 10,470 Site admin
    No - as Steph says, this is a known issue. Bug already noted.

    Allan
  • MySinsMySins Posts: 1Questions: 0Answers: 0
    Guys,

    Here is the quick solution to it.....
    Basically, you need to set the Radio button as checked via JS/JQuery after the DataTable is Applied.

    Below link is used for Extension of Demo
    http://datatables.net/forums/discussion/14180

    JQuery code

    $(document).ready(function() {
    $('#department_permissions_table').dataTable();
    }
    // code to set the value as checked.
    jQuery("#deptartment_permission[2]").attr('checked', 'checked');
    );


    JS Code

    radiobtn = document.getElementById("theid");
    radiobtn.checked = true;
This discussion has been closed.