Possible BUG with radio buttons

Possible BUG with radio buttons

BLacKR1D3RBLacKR1D3R Posts: 2Questions: 0Answers: 0
edited April 2010 in Bug reports
Good day

First, sorry for my English ;)

ok, i have a datatable with a radio button group in a column, the data for the table are provided dynamic through jsp table bean.

The bug happens in this situation, if i have a radio button with values long to 2 chars, and have the checked attribute, the datatable don't draw the radio button checked but all the others attributes and data, it so weird, I tested already datatables 1.5.2, the data isolated in a single html, and clean css

nothings works

even i take the zero config example for the latest version and replace the data with my data don't work well

in the attached file u find this last try (zero config with my data), if you disabled the plugin the table works well, if u active dont

(NOTE its a old app, dont blame me for the html code xD)

ATTACHED: http://www.megaupload.com/?d=NRJCWQUK

thanks in advance

Replies

  • BLacKR1D3RBLacKR1D3R Posts: 2Questions: 0Answers: 0
    i forget something, the only radio button that don't draw well is the one with the name JORGE VICENTE JOYA ROJAS in the column "Nombre"

    line 3020 approx
  • Web-Creations.atWeb-Creations.at Posts: 1Questions: 0Answers: 0
    edited October 2010
    I've the same problem with version 1.7.2. Any solutions?
  • addr555addr555 Posts: 2Questions: 0Answers: 0
    when 'sScrollY' is enabled, the default checked radio button is not being set in Firefox 3.6:

    $("#table").dataTable({
    "sScrollY": "170px",
    "aoColumns": [{"fnRender": function(oObj) {
    return "";
    }]
    });

    removing: "sScrollY": "170px", the default checked radio button will work.
  • allanallan Posts: 63,692Questions: 1Answers: 10,500 Site admin
    This seems to work fine for me:

    [code]
    $(document).ready(function() {
    $('#example').dataTable( {
    "sScrollY": "200px",
    "bPaginate": false,
    "aoColumnDefs": [
    {
    "fnRender": function(oObj) {
    return "";
    },
    "aTargets": [ 0 ]
    }
    ]
    } );
    } );
    [/code]
    The last (and only the last) radio button is marked as checked - since they are all in the same group there can only be one checked.

    Allan
  • addr555addr555 Posts: 2Questions: 0Answers: 0
    Thanks Allan for looking into this.... I've also downloaded: http://www.datatables.net/releases/DataTables-1.7.5.zip, and modified: examples\basic_init\scroll_y.html . I changed the first td element from 'Trident' to ''. The radio is checked in IE 8 but not in Firefox 3.6 . Here's a screen shot: http://www.flickr.com/photos/56677959@N03/5301467171/
  • allanallan Posts: 63,692Questions: 1Answers: 10,500 Site admin
    Thanks for the screenshot - very helpful! The problem appears to be with how the table columns have their width's calculated and the uniqueness of the radio button name. Basically DataTables will try to find the cell in each column with the maximum string length and then insert that into a temporary table allowing the browser to calculate the widths for us. However, that is done by a clone operation and it's cloning the radio button - so the clone button (which is subsequently removed) gets the check - removing it from the old one!

    In Firefox this can be fixed using '$('input', nTd).each( function () { this.name += "_clone"; } );' inserted into line 5359 in DataTables 1.7.5, but for some reason that I can't quite fathom this doesn't work in Webkit. More investigation is required there I think.

    For the moment you can disable auto width, and just assign widths to the columns manually. Thanks for letting me know about this one.

    Allan
This discussion has been closed.