guys i want the column names to be dinamic in case it is changed so i dont have to put it namually .. here is my code
jqGrid11.prototype = {
display : function() {
$('body').append(this.html.join(""));
$("#jqGrid").jqGrid({
url : "index.jsp",
colModel : [ {
label : 'Department Name',
name : 'Department Name ',
width : 200
}, {
label : 'id',
name : 'id',
key : true,
width : 200
}, {
label : 'Employees',
name : 'Employees ',
width : 500
} ],
viewrecords : true,
width : 780,
height : 250,
rowNum : 20,
pager : "#jqGridPager"
});
for (var i = 0; i < this.data.length; i++) {
$("#jqGrid").jqGrid("addRowData", i + 1, this.data[i]);
}
}
};
so i want the department name and id and employee to be generated dynamically