lundi 21 mars 2016

function styleCheckbox() in jqgrid from ace doesn't work perfectly

I copied jqgrid.html from ace demo, and activated function styleCheckbox() to change the style of multiselecting checkboxs, but something got wrong. The checkbox didn't change when I clicked the square, while it worked normally when I clicked other areas of the row.

the definition of function styelCheckbox():

function styleCheckbox(table) {
    $(table).find('input:checkbox').addClass('ace')
            .wrap('<label />')
            .after('<span class="lbl align-top" />')
            .removeClass('cbox');


            $('.ui-jqgrid-labels th[id*="_cb"]:first-child')
            .find('input.cbox[type=checkbox]').addClass('ace')
            .wrap('<label />').after('<span class="lbl align-top" />')
            .removeClass('cbox');

}

called after jqgrid loaded completely:

loadComplete : function() {
            var table = this;
            setTimeout(function(){
            styleCheckbox(table);
            }, 0);
},




Aucun commentaire:

Enregistrer un commentaire