我想像这样创建 jqGrid
我可以划分身体 jqGrid 我写这段代码
var data = [[1, 45, "E123", "1/1/11", "Done", 100], [2, 46, "E124", "1/12/11", "Done", 100]];
$("#grid").jqGrid({
datatype: "local",
height: 250,
colNames: ["SNO", "OrderID", "Location", "Date", "Status", "Amount"],
colModel: [{
name: 'SNO',
index: 'SNO',
width: 60},
{
name: 'OrderID',
index: 'OrderID',
width: 90,
formatter:orderFmatter},
{
name: 'Location',
index: 'Location',
hidden: true},
{
name: 'Date',
index: 'Date',
width: 80,
formatter:dateStatusFmatter},
{
name: 'Status',
index: 'Status',
width: 80,
hidden: true},
{
name: 'Amount',
index: 'Amount',
width: 80}
],
caption: "Stack Overflow Example",
});
var names = ["SNO", "OrderID", "Location", "Date", "Status", "Amount"];
var mydata = [];
for (var i = 0; i < data.length; i++) {
mydata[i] = {};
for (var j = 0; j < data[i].length; j++) {
mydata[i][names[j]] = data[i][j];
}
}
for (var i = 0; i <= mydata.length; i++) {
$("#grid").jqGrid('addRowData', i + 1, mydata[i]);
}
function orderFmatter( cellvalue, options, rowObject )
{
return "<div>" + cellvalue + "</div><hr /><div>" + rowObject.Location + "</div>";
}
function dateStatusFmatter( cellvalue, options, rowObject )
{
return "<div>" + cellvalue + "</div><hr /><div>" + rowObject.Status+ "</div>";
}
此代码创建此网格
在这个网格中,我想要像正文网格一样的分页眉