我正在尝试调用 jqGrid 的 setGridWidth 函数,但出现错误:
对象 [对象对象] 没有方法“setGridWidth”
我敢肯定这是一件愚蠢的事情。这是显示网格的代码(很好),然后尝试调整它的大小。
$("#jqGridElement").jqGrid({
datastr: tableSrc,
jsonReader: { repeatitems: false },
datatype: "jsonstring",
colNames: ['title', 'subtitle'],
colModel: [
{ name: 'title', index: 'title', width: 55 },
{ name: 'subtitle', index: 'subtitle'}],
height: 'auto',
gridview: true
});
$("#jqGridElement").setGridWidth(600);'
编辑
我也试过:
var gridObj = $("#jqGridElement").jqGrid({ datastr: tableSrc, .......
gridObj.setGridWidth(300);
结果相同