这是我的代码
$(document).ready(function () {
$('#jqgProducts').jqGrid({
url: '/Home/GridSampleData/', // url from wich data should be requested
datatype: 'json', // type of data
mtype: 'GET', // url access method type
colNames: ['userid', 'username', 'email', 'contact', 'password'],
colModel: [ // columns model
{ name: 'userId', index: 'userId', align: 'left',
editable: false },
{ name: 'username', index: 'username', align: 'left',
editable: true, edittype: 'text',
editoptions: { maxlength: 20 },
editrules: { required: true} },
{ name: 'email', index: 'email', align: 'left', editable: true,
edittype: 'text', editoptions: { maxlength: 50 },
editrules: { required: true} },
{ name: 'contact', index: 'contact', align: 'left',
editable: true, edittype: 'text',
editoptions: { maxlength: 20 }, editrules: { required: true} },
{ name: 'password', index: 'password', align: 'left',
editable: true, edittype: 'password',
editoptions: { maxlength: 20 },
editrules: { required: true} }
],
pager: $('#jqgpProducts'), // pager for grid
rowNum: 5, // number of rows per page
sortname: 'userId', // initial sorting column
sortorder: 'asc', // initial sorting direction
viewrecords: true, // we want to display total records count
width: '600', // grid width
height: 'auto' // grid height
});
});
答案 0 :(得分:19)
将“toppager:true”包含在jqGrid选项列表中。这完全符合您的要求:“启用此选项后,将一个寻呼机元素放置在标题下方的网格顶部(如果可用)。如果定义了另一个寻呼机,则它们可以共存并同步刷新。”
您可以在http://www.trirand.com/jqgridwiki/doku.php?id=wiki:options
上找到的完整选项列表答案 1 :(得分:0)
这已经晚了4年,但我看到了类似这样的模板选项
template: '<div>' +
'<div class="jqgrid-pagination"></div>' +
'<table></table>' +
'<div class="jqgrid-pagination"></div>' +
'</div>',