我不知道分页按钮的代码有什么问题不能显示
function LoadAgencies(Action, User, FA) {
$grid = $("#grdAgencies");
$grid.jqGrid({
url: "dhFollowUp.ashx?1=1",
postData: {
Action: Action,
User: User,
FANo: FA
},
height: 320,
width: 760,
datatype: "json",
mtype: "GET",
colNames: ['Mark for Reports', 'OA #', 'Oper. Agency', 'OB #', 'Building Name','Survey Count', 'CADR', 'Select', 'EntID'],
colModel: [
{ name: 'ab', index: 'ab', width: 45, formatter: 'checkbox', formatoptions: { disabled: false }, align: 'center', sortable: false, search: false, hidden: true}, //, align: 'center'
{ name: 'OANo', index: 'OANo', width: 30, sortable: false, search: false, align: 'center', editable: false },
{ name: 'OANm', index: 'OANm', width: 125, sortable: true, search: true, align: 'left', editable: false },
{ name: 'OBNo', index: 'OBNo', width: 30, sortable: false, search: false, align: 'center', editable: false },
{ name: 'OBNm', index: 'OBNm', width: 125, sortable: true, search: true, align: 'left', editable: false },
{ name: 'FCnt', index: 'FCnt', width: 60, sortable: false, search: false, align: 'center', editable: false },
{ name: 'ab1', index: 'ab1', width: 40, sortable: false, search: false, align: 'center', formatter: CADRLink}, //
{ name: 'ab2', index: 'ab2', width: 40, sortable: false, search: false, align: 'center', formatter: SurveyLink}, //
{ name: 'EntID', index: 'EntID', width: 10, hidden: true },
],
emptyrecords: "No records for this Agency",
loadtext: "Loading Agency Records...",
viewrecords: true,
gridview: true,
rowNum: 1,
rowList: [1,2,5],
contentType: "application/json; charset=utf-8",
caption: "Follow Up Agencies",
multiselect: true,
pgbuttons: true,
pager: '#pgrdAgencies',
gridComplete: function () {
}, // end of gridcomplete
onSortCol: function (index, idxcol, sortorder) {
if (this.p.lastsort >= 0 && this.p.lastsort !== idxcol
&& this.p.colModel[this.p.lastsort].sortable !== false) {
$(this.grid.headers[this.p.lastsort].el).find(">div.ui-jqgrid-sortable>span.s-ico").show();
}
},
loadError: function (xhr, status, error) {
MsgBox("Loading FollowUp Agency Grid: " + error);
} //end of loadError
}); // end of grdAgencies
colModel = $grid.jqGrid('getGridParam', 'colModel');
$('#gbox_' + $.jgrid.jqID($grid[0].id) +
' tr.ui-jqgrid-labels th.ui-th-column').each(function (i) {
var cmi = colModel[i], colName = cmi.name;
if (cmi.sortable !== false) {
$(this).find('>div.ui-jqgrid-sortable>span.s-ico').show();
} else if (!cmi.sortable && colName !== 'rn' && colName !== 'cb' && colName !== 'subgrid') {
$(this).find('>div.ui-jqgrid-sortable').css({ cursor: 'default' });
}
});
var AgencyGrid = jQuery("#grdAgencies").jqGrid('navGrid', "#pgrdAgencies", { edit: false, add: false, del: false, search: false, refresh: false });
jQuery("#grdAgencies").jqGrid('navButtonAdd', "#pgrdAgencies", {
caption: "Toggle Search", title: "Toggle Search Toolbar", buttonicon: 'ui-icon-pin-s',
onClickButton: function () {
AgencyGrid[0].toggleToolbar()
}
});
jQuery("#grdAgencies").jqGrid('navButtonAdd', "#pgrdAgencies", {
caption: "Clear Search", title: "Clear Search", buttonicon: 'ui-icon-refresh',
onClickButton: function () {
AgencyGrid[0].clearToolbar()
}
});
jQuery("#grdAgencies").jqGrid('filterToolbar');
} // LoadAgencys的结尾
有一个下拉列表,用户可以从中选择以填充网格。打开页面时页面上会显示网格结构。 这就是代码:
$('#ddlSelectFA').change(function () {
if ($('#ddlSelectFA').val() == 0) {
MsgBox('Please select a Fiscal Agency');
}
else {
$('#grdAgencies').jqGrid('setGridParam', { postData: { Action: "MANAGEAGENCIES", User: $('#hdfldUser').val(), FANo: $('#ddlSelectFA').val() } }).trigger("reloadGrid");
}
}); // end of ddlSelectFA change
我希望上面的内容足以让我知道为什么我没有看到按钮,即使我有(4)条记录并且每页显示1条。
谢谢