9

这是我的代码

 $(document).ready(function () {
     $('#jqgProducts').jqGrid({
         url: '/Home/GridSampleData/', // url from which 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
     });
 });
4

2 回答 2

20

在 jqGrid 选项列表中包含“toppager: true”。这正是您想要的:“启用此选项后,在标题下方的网格顶部放置一个寻呼机元素(如果可用)。如果定义了另一个寻呼机,则两者可以共存并同步刷新。”

您可以在http://www.trirand.com/jqgridwiki/doku.php?id=wiki:options上找到完整的选项列表

于 2010-04-23T06:45:30.357 回答
0

这已经晚了 4 年,但我看到了这样的东西,模板选项

 template: '<div>' +
             '<div class="jqgrid-pagination"></div>' +
             '<table></table>' +
             '<div class="jqgrid-pagination"></div>' +               
           '</div>',
于 2015-05-04T22:16:18.183 回答