I am using below code for creating custom formatter button :
colModel.push({ name : 'Id',index : 'Id', width: 100, sortable: false,
resizable: false, hidedlg: true, search: false, align: "center",
fixed: true, viewable: false,
formatter: function (cellvalue, options, rowObject) {
if (rowObject[8] === "Active") {
return "<button class=\"resend\">Resend</button>";
}
return "-";
}
});
JQGrid Code :
jQuery("#" + gridName).jqGrid({
url : gridUrl,
datatype : "json",
width : 1000,
height : 200,
colNames : colNames,
colModel : colModel,
rowNum : 20,
rowList : [ 10, 15, 20 ],
viewrecords : true,
pager : "#" + pager,
multiselect : false,
loadonce : true,
repeatitems: true,
imgpath : "themes/basic/images",
caption : "",
beforeSelectRow: function (rowid, e) {
return true;
},
}).navGrid("#" + pager, {
edit : false,
add : false,
del : false,
search : false,
refresh : false
}, {}, // Default for edit
{},// Default for add
{}// Default for delete
).navButtonAdd("#" + pager, {
caption : "Refresh",
buttonicon : "ui-icon-refresh",
onClickButton : function() {
var urlStr = getLastUrl(gridUrl);
jQuery("#" + gridName).jqGrid('setGridParam', {
url : urlStr,
mtype : 'POST',
datatype : 'json'
}).trigger("reloadGrid");
return true;
}
}).navButtonAdd("#" + pager, {
caption : "Export",
buttonicon : "ui-icon-save",
onClickButton : function() {
}
});
When grid is loading the button are displaying fine based on the logic, but after pagination buttons are not displaying in grid.
Not able to understand what happen. How to solve this issue?
I am using
jqGrid 4.0.0 - jQuery Grid