我是jqGrid的新手,我刚开始在asp.net web表单中对jqGrid进行示例。我使用数组方法进行示例,没有任何额外的功能。现在我正在尝试将寻呼机功能添加到jqGrid。添加寻呼机功能时,我收到以下错误。
Microsoft JScript运行时错误:无法获取属性的值 'integer':object为null或undefined
错误来自插件的以下部分
k=b.jgrid.formatter.integer||{}
我正在为您提供我迄今为止所做的代码片段。
Aspx Page
<asp:ScriptManager ID="SmjqGrid" runat="server" >
<Scripts>
<asp:ScriptReference Path="~/Scripts/jQuery.1.9.1.min.js" />
<asp:ScriptReference Path="~/Scripts/jquery-ui-1.8.2.custom.min.js" />
<%--<asp:ScriptReference Path="~/Scripts/grid.locale-en.js" />--%>
<asp:ScriptReference Path="~/Scripts/jquery.jqGrid.min.js" />
<asp:ScriptReference Path="~/Scripts/ui.multiselect.js" />
</Scripts>
</asp:ScriptManager>
<script type="text/javascript">
function pageLoad() {
jQuery("#list4").jqGrid({
datatype: "local",
height: 250,
colNames: [ 'Date', 'Client', 'Amount', 'Tax', 'Total'],
colModel: [
{ name: 'invdate', index: 'invdate', width: 90, sorttype: "date" },
{ name: 'name', index: 'name', width: 100 },
{ name: 'amount', index: 'amount', width: 80, align: "right", sorttype: "float" },
{ name: 'tax', index: 'tax', width: 80, align: "right", sorttype: "float" },
{ name: 'total', index: 'total', width: 80, align: "right", sorttype: "float" }
],
multiselect: true,
caption: "Sample On jqGrid",
rowNum: 5,
pager: '#pager'
});
var mydata = [
{ id: "1", invdate: "2007-10-01", name: "test", note: "note", amount: "200.00", tax: "10.00", total: "210.00" },
{ id: "2", invdate: "2007-10-02", name: "test2", note: "note2", amount: "300.00", tax: "20.00", total: "320.00" },
{ id: "3", invdate: "2007-09-01", name: "test3", note: "note3", amount: "400.00", tax: "30.00", total: "430.00" },
{ id: "4", invdate: "2007-10-04", name: "test", note: "note", amount: "200.00", tax: "10.00", total: "210.00" },
{ id: "5", invdate: "2007-10-05", name: "test2", note: "note2", amount: "300.00", tax: "20.00", total: "320.00" },
{ id: "6", invdate: "2007-09-06", name: "test3", note: "note3", amount: "400.00", tax: "30.00", total: "430.00" },
{ id: "7", invdate: "2007-10-04", name: "test", note: "note", amount: "200.00", tax: "10.00", total: "210.00" },
{ id: "8", invdate: "2007-10-03", name: "test2", note: "note2", amount: "300.00", tax: "20.00", total: "320.00" },
{ id: "9", invdate: "2007-09-01", name: "test3", note: "note3", amount: "400.00", tax: "30.00", total: "430.00" }
];
for (var i = 0; i <= mydata.length; i++) {
jQuery("#list4").jqGrid('addRowData', i + 1, mydata[i]);
}
}
</script>
<table id="list4"></table>
<div id="pager"></div>
希望我的问题足够明确。
答案 0 :(得分:4)
您应该包含grid.locale-en.js
(您在代码中注明了相应的行)。它需要在jquery.jqGrid.min.js
之前加入(请参阅the documentation)
答案 1 :(得分:0)
这是一个老问题,但我知道人们仍然使用jqGrid:)
所以,我在网上找不到任何帮助。唯一有帮助的东西,我找不到任何理由,是这个错误没有发生,只有在使用缩小的jqGrid脚本时,寻呼机才能正常工作...(意味着用jqgrid.min替换jqgrid.src.js .js文件)。我不知道为什么它有所帮助 - 可能是因为我正在处理的页面正在运行大约20个不同的脚本,所以可能存在某种冲突问题。