【发布时间】:2013-05-16 21:21:25
【问题描述】:
我试图将 navgrid 添加到工作的 jqgrid 但它没有显示。 imo 文档可能会更好。
$("#" + id + "Table").jqGrid({
datatype: "local",
data: data,
colNames: colNames,
colModel: colModel,
pager: '#' + id + 'Table',
autowidth: true,
scroll: false,
forceFit: true,
shrinkToFit: true, //Width of columns should be expressed in integers which add to 100
rowNum: <xsl:value-of select="$totalLength"/>,
rowTotal: <xsl:value-of select="$totalLength"/>,
sortname: defaultSortColumn,
sortorder: defaultSortOrder,
url: "fs/servlet/CS"
});
$("#" + id + "Table").jqGrid('navGrid',"#" + id + "Pager",{edit:true,add:true,del:true});
【问题讨论】:
-
您使用的是什么版本的 jqGrid?我升级时有一些组件损坏。试试: $("#" + id + "Table").jqGrid('navGrid',"#navGrid",{edit:true,add:true,del:true});
-
你应该使用
"#" + id + "Pager"作为jqGrid的pager参数的值。您当前的代码看起来$("#" + id + "Table").jqGrid({..., pager: '#' + id + 'Table', ...);这是您的打字错误。此外,我建议您使用gridview: true, autoencode: true, height: "auto"选项并删除不需要的scroll: false。 -
确实错字了。谢谢奥列格
标签: jqgrid