我的脚本上有这个声明,我想选择可以在上面看到的列..
$("#list").jqGrid({
url: '/persons.ashx',
datatype: 'xml',
mtype: 'GET',
colNames: ['Name', 'Age'],
colModel: [
{ name: 'Name', index: 'Name', width: 100, align: 'center', editable: true, editoptions: { size: 30 }, editrules: { edithidden: false }, sortable: true },
{ name: 'Age', index: 'Age', width: 100, align: 'center', editable: true, editoptions: { size: 30 }, editrules: { edithidden: false }, sortable: true }
]
ajaxSelectOptions: {
data: {
codSelected: function () { return _codSelected; }
}
},
onSelectRow: function (rowid) {
_codSelected = rowid;
},
autoencode: true,
pager: '#pager',
rowNum: 20,
sortname: 'Name',
sortorder: 'asc',
sortable: true,
autowidth: false,
width: 999,
height: -1,
shrinkToFit: true,
viewrecords: true,
gridview: true,
caption: 'Persons',
editurl: ''
});
jQuery("#list").jqGrid('navGrid',
'#pager',
{
add: false,
del: false,
edit: false,
search: true,
refresh: true,
cloneToTop: true
},
{ width: 360, resize: false, closeAfterEdit: true, recreateForm: true, viewPagerButtons: true
},
{ width: 360, resize: false, closeAfterAdd: true, recreateForm: true },
{}, //Delete action
{ closeAfterSearch: true, closeOnEscape: true }
);
});
//CODE ADDDED TO CAN CHOOSE COLUMNS
jQuery("#list").jqGrid('navButtonAdd', '#pager', {
caption: "",
buttonicon: "ui-icon-calculator",
title: "Choose columns",
onClickButton: function () {
$(this).jqGrid('columnChooser');
}
});
我有 14 列,但我在屏幕上看不到所有内容,在这个例子中我只放了 2 列,但我看不到重新加载按钮附近的选择按钮,事实上,不能选择任何列来订购它..
谁能帮我?
谢谢。