jquery.jqGrid.min.js不工作
我使用了3.8.2 JQGrid文件jquery.JQGrid.min.js,这是一个只需要包含其中所有模块的文件,下载时将从那里选择这些模块,但其中一个错误=}不起作用。navGrid不是一个函数 然后我从下载了tonytomov-jqGrid-c3a2a2d文件夹,并使用了它,它有路径指向驻留在js文件夹中的所有模块,并且工作正常。下面是github中的jquery.jqGrid.js文件。我知道jquery.jqGrid.js是用于开发的,但是jquery.jqGrid.min.js根本不适合我 为什么?。我做了很多实验,这就是我所发现的。也许我错过了什么jquery.jqGrid.min.js不工作,jqgrid,Jqgrid,我使用了3.8.2 JQGrid文件jquery.JQGrid.min.js,这是一个只需要包含其中所有模块的文件,下载时将从那里选择这些模块,但其中一个错误=}不起作用。navGrid不是一个函数 然后我从下载了tonytomov-jqGrid-c3a2a2d文件夹,并使用了它,它有路径指向驻留在js文件夹中的所有模块,并且工作正常。下面是github中的jquery.jqGrid.js文件。我知道jquery.jqGrid.js是用于开发的,但是jquery.jqGrid.min.js根本不
//This file should be used if you want to debug and develop
function jqGridInclude()
{
var pathtojsfiles = "/Scripts/js/"; // need to be ajusted
// set include to false if you do not want some modules to be included
var modules = [
{ include: true, incfile:'i18n/grid.locale-en.js'}, // jqGrid translation
{ include: true, incfile:'grid.base.js'}, // jqGrid base
{ include: true, incfile:'grid.common.js'}, // jqGrid common for editing
{ include: true, incfile:'grid.formedit.js'}, // jqGrid Form editing
{ include: true, incfile:'grid.inlinedit.js'}, // jqGrid inline editing
{ include: true, incfile:'grid.celledit.js'}, // jqGrid cell editing
{ include: true, incfile:'grid.subgrid.js'}, //jqGrid subgrid
{ include: true, incfile:'grid.treegrid.js'}, //jqGrid treegrid
{ include: true, incfile:'grid.grouping.js'}, //jqGrid grouping
{ include: true, incfile:'grid.custom.js'}, //jqGrid custom
{ include: true, incfile:'grid.postext.js'}, //jqGrid postext
{ include: true, incfile:'grid.tbltogrid.js'}, //jqGrid table to grid
{ include: true, incfile:'grid.setcolumns.js'}, //jqGrid setcolumns
{ include: true, incfile:'grid.import.js'}, //jqGrid import
{ include: true, incfile:'jquery.fmatter.js'}, //jqGrid formater
{ include: true, incfile:'JsonXml.js'}, //xmljson utils
{ include: true, incfile:'grid.jqueryui.js'}, //jQuery UI utils
{ include: true, incfile:'jquery.searchFilter.js'} // search Plugin
];
var filename;
for(var i=0;i<modules.length; i++)
{
if(modules[i].include === true) {
filename = pathtojsfiles+modules[i].incfile;
if(jQuery.browser.safari) {
jQuery.ajax({url:filename,dataType:'script', async:false, cache: true});
} else {
if (jQuery.browser.msie) {
document.write('<script charset="utf-8" type="text/javascript" src="'+filename+'"></script>');
} else {
IncludeJavaScript(filename);
}
}
}
}
function IncludeJavaScript(jsFile)
{
var oHead = document.getElementsByTagName('head')[0];
var oScript = document.createElement('script');
oScript.setAttribute('type', 'text/javascript');
oScript.setAttribute('language', 'javascript');
oScript.setAttribute('src', jsFile);
oHead.appendChild(oScript);
}
}
jqGridInclude();
在
jquery.jqGrid.min.js
模块:grid.base.js;
jquery.fmatter.js;grid.custom.js;
grid.common.js;
jquery.searchFilter.js;
grid.inlinedit.js;grid.celledit.js;
jqModal.js;jqDnR.js;grid.subgrid.js;
grid.grouping.js;grid.treegrid.js;
grid.import.js;JsonXml.js;
grid.setcolumns.js;grid.postext.js;
grid.tbltogrid.js;grid.jqueryui.js
您选择了所有jqGrid模块,但grid.formedit.js除外。其中的名称为“表单编辑”(请参阅“编辑”组)。我已经测试过了,现在可以从下载所有模块了。因此,这不应该是一个技术问题
因此,您只需再次下载jqGrid,在
jquery.jqGrid.min.js
中使用navGrid
不会有任何问题。请在问题文本中包含jquery.jqGrid.min.js
开头评论中的“模块”列表,我描述了它。jquery.jqGrid.min.js=*模块:grid.base.js;jquery.fmatter.js;grid.custom.js;grid.common.js;jquery.searchFilter.js;grid.inlinedit.js;grid.celledit.js;jqModal.js;jqDnR.js;grid.subgrid.js;grid.grouping.js;grid.treegrid.js;grid.import.js;JsonXml.js;grid.setcolumns.js;grid.postext.js;grid.tbltogrid.js;grid.jqueryui.js;所有这些模块都已下载。我把jquery.jqGrid.min.js放在上面提到的所有模块的scripts文件夹和js文件夹中。仍然不起作用。尝试将文件移动到同一文件夹中,但未成功:(Oleg你也能回答这个问题吗?这个问题有参考链接,你已经用代码发布了答案,但我无法让它工作。我会在几个小时后尝试回答你的两个问题。要回答另一个问题,我需要定义公司
类和相应jqGrid.com的定义同样是模块:grid.base.js;jquery.fmatter.js;grid.custom.js;grid.common.js;grid.formedit.js;jquery.searchFilter.js;grid.inlinedit.js;grid.celledit.js;jqDnR.js;grid.subgrid.js;grid.grouping.js;grid.treegrid.import.js;js.js;grid.setcolumns;grid.postext.js;grid.tbltogrid.js;grid.jqueryui;。但是我得到了错误b.jgrid.formatter未定义[在此错误上中断]”;s+=a.p.toppager?s?”,“+a.p.toppager:…=b.fmatter.util.NumberFormat(w,G);C=。我已添加JS代码:(我在谷歌上搜索了这个问题,发现它是由语言文件引起的。修复了它,工作正常。非常感谢你的帮助。希望能经常收到你的回复,因为我正在测试JQGrid很多。
jQuery().ready(function () {
var lastSel;
jQuery("#sandgrid").jqGrid({
url: '/JQSandbox/MyGridData/',
datatype: 'json',
mtype: 'POST',
height: 255,
width: 640,
colNames: ['Index', 'Name', 'City', 'State'],
colModel: [
{ name: 'companyID', index: 'companyID', width: 5 },
{ name: 'companyName', index: 'companyName', width: 30 },
{ name: 'companyCity', index: 'companyCity', width: 30 },
{ name: 'companyState', index: 'companyState', width: 4, sortable: false}],
pager: jQuery('#sandgridp'),
rowNum: 5,
rowList: [5, 10, 20, 50],
sortname: 'companyID',
sortorder: "desc",
viewrecords: true,
altRows: true,
caption: 'Sandbox Grid',
ondblClickRow: function (id) {
if (id && id !== lastSel) {
jQuery('#sandgrid').restoreRow(lastSel);
lastSel = id;
alert("You've seleted " + id);
}
},
subGrid: true,
subGridUrl: '/JQSandbox/MySubGridData/',
subGridModel: [
{
name: ['Name', 'Department', 'Hire Date', 'Supervisor'],
width: [80, 20, 80, 10],
align: ['left', 'left', 'left', 'center'],
params: ['companyID']
}]
}).navGrid('#sandgridp', { edit: false, add: false, del: false });
});