mun*_*nir 9 model-view-controller jqgrid pager
这是我的代码
$(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
});
});
Run Code Online (Sandbox Code Playgroud)
Ole*_*leg 19
将"toppager:true"包含在jqGrid选项列表中.这完全符合您的要求:"启用此选项时,将一个寻呼机元素放置在标题下方的网格顶部(如果可用).如果定义了另一个寻呼机,则它们可以共存并同步刷新."
您可以在http://www.trirand.com/jqgridwiki/doku.php?id=wiki:options上找到完整的选项列表
| 归档时间: |
|
| 查看次数: |
8514 次 |
| 最近记录: |