mardi 19 avril 2016

adding checkboxes to each row in jqgrid

guys i want to add checkboxes to each row to jqgrid .. here is my code

display : function() {
                        var html = [];
                        var check = 0;
                        html.push("<table id='"+this.id+"" + "'>\n</table>");
                        html.push("<div id='pagger_" + this.id + "'></div>");
                        $('body').append(html.join(""));
                        $("#" + this.id).jqGrid({
                                url : "index.jsp",
                                styleUI : 'Bootstrap',
                                datatype : "local",
                                //data : this.data,
                                colModel : this.getColModels(this.data[0]),

                                viewrecords : true,
                                width : 1300,
                                height : 250,
                                rowNum : 50,
                                pager : "#pagger_" + this.id
                        });
                        
                        for (var i = 0; i <= this.data.length; i++) {
                                $("#" + this.id).jqGrid('addRowData', i + 1, this.data[i],"vtgtr");
                                
                                //html.push("<tr><td><input type='checkbox' id='chk_"+ this.check + "'/></td>");
                                //check++;
                        }
                        
                },

i tried a lot but the checkboxes never added to the rows .. any help ??

Aucun commentaire:

Enregistrer un commentaire