我有一个有趣的问题。我在多个网格上完成了这个工作。在这种情况下,第一个网格工作正常,第二个网格未能加载。并提供以下错误:this.p is undefined jqgrid
this.p未定义
... sArray(ⅰ)){P =真; H = “最后”; U = F}否则{I = [I]; P = false} this.each(function(){var D = il .. line 140 jquery.jqGrid.min.js
用户doble单击行并设置一些变量,然后调用函数locationGrid( )
就像我说这对我多次在过去的工作,但是这个网页它失败的我有双重检查,按照下图我得到的数据备份:。
{“d”:“{\”total \“:1,\”page \“:0,\”records \“:1,\”rows \“:[{\”invPartLocId \“:1053,\ “inventoryMasterId \”:5,\ “位置\”:空,\ “ITEMTYPE \”:\ “S \”,\ “currentQanity \”:1,\ “adjustedQauntity \”:0,\ “newLocationQty \”:0 ,\“deptCode \”:\“1401 \”}]}“}
任何帮助,将不胜感激。
function locationGrid() {
$('#invLocAdjustGrid').jqgrid({
height: 290,
loadui: "block",
datatype: function (rdata) { getLocationData(rdata); },
colNames: ['invPartID', 'locationPartID', 'Loctaion', 'Type', 'Current QTY', 'Adjusted QTY', 'New Location QTY', 'Dept. Code'],
colModel: [
{ name: 'invPartLocId', width: 2, sortable: false, editable: false, hidden: true },
{ name: 'inventoryMasterId', width: 2, sortable: false, editable: false, hidden: true },
{ name: 'location', width: 250, editable: false, sortable: false },
{ name: 'itemType', width: 120, editable: false, sortable: false, align: 'center' },
{ name: 'currentQanity', width: 50, editable: false, sortable: false },
{ name: 'adjustedQauntity', width: 50, editable: false, sortable: false },
{ name: 'newLocationQty ', width: 50, editable: false, sortable: false },
{ name: 'deptCode', width: 50, editable: false, sortable: false }
],
pager: jQuery('#rptCodesPager'),
viewrecords: true,
width: 890,
gridComplete: function() {
$('#load_invLocAdjustGrid').hide();
$(this).prop('p').loadui = 'enable';
$('#lui_invLocAdjustGrid').hide();
},
afterInsertRow: function (rowid, aData) {
},
ondblClickRow: function (rowid) {
var myID = $('#invLocAdjustGrid').getCell(rowid, 'invPartLocId');
Ldclicked(myID);
}
});
}
function getLocationData(rdata) {
var theID = tempID;
tempID = "";
var myDTO = { 'id': theID };
var toPass = JSON.stringify(myDTO);
$.ajax({
type: 'POST',
contentType: "application/json; charset=utf-8",
dataType: "json",
url: "INV_Inventory_Adjustment.aspx/getInventoryLocationById",
data: toPass,
success: function (data, textStatus) {
if (textStatus == "success")
ReceivedLocationData(JSON.parse(getMain(data)).rows);
},
error: function (data, textStatus) { alert('An error has occured retrieving data!'); }
});
}
function ReceivedLocationData(data) {
var thegrid = $('#invLocAdjustGrid');
var isGood = data.length;
for (var i = 0; i < isGood; i++) {
thegrid.addRowData(i + 1, data[i]);
}
}
您应该使用'jquery.jqGrid.src.js'而不是'jquery.jqGrid.min.js'来查看错误更清楚的地方。此外,你应该包含调用'locationGrid'的代码。我认为有理解问题。'locationGrid'只能被调用** **一次**。 – Oleg 2012-03-05 20:49:59
我切换到使用jquery.jqGrid.src.js,失败是在2818行 ni = t.p.rownumbers === true? 1:0; – 2012-03-06 12:28:46