gpt4 book ai didi

jquery - 未捕获的类型错误 : Cannot read property 'errcap' of undefined

转载 作者:行者123 更新时间:2023-12-01 04:04:54 29 4
gpt4 key购买 nike

我在 chrome 中遇到错误“Uncaught TypeError: Cannot read property 'errcap' of undefined”。

enter image description here

在 Firefox 上,我遇到了这个: enter image description here

我使用的是 jqgrid 4.8.2。

这是我的代码:

$("#Grid").jqGrid({
url: "/Templates/Dometic/Services/DometicGenral.svc/GetVehiclesByOemId",
datatype: 'json',
mtype: 'POST',
height: 'auto',
colNames: [
'Edit',
'ID',
'Vehicle brand',
'Model Information',
'Created by',
'Date created',
'Last modified by',
'Date last modified',
'Manage products'
],
shrinkToFit: true,
colModel: [
{
name: "EditAction",
width: 60,
fixed: true,
search: false,
sortable: false,
resize: false,
formatter: "actions",
formatoptions: {
keys: false,
editbutton: true,
delbutton: false,
editformbutton: false,
onSuccess: function (response) {
if (response.status == 200) {

$("#Grid").jqGrid("setGridParam", { datatype: "json" }).trigger("reloadGrid"); //Reloads the grid after edit

return [false];
} else {
return [true];
}
},
extraparam: {
oper: "edit",
Id: function () {
var sel_id = $("#Grid").jqGrid("getGridParam", "selrow");
var value = $("#Grid").jqGrid("getCell", sel_id, "Id");
return value;
}
},
url: "#"
}
},
//{ name: 'Id', index: 'Id', key: true, sortable: false, search: false, width: 80, title: false, formatter: editcoulmnformatefunction },
//{ name: 'Id', index: 'Id', sortable: false, search: false, width: 60, title: false, formatter: deleteFormatter },
{ name: 'Number', index: 'Number', editable:false, width: 80, searchoptions: { sopt: ['cn'], clearSearch: false }, title: false },

{
name: 'Brand', index: 'Brand', sortable: true, searchoptions: { sopt: ['cn'], clearSearch: false }, title: false,
editable: true, edittype: 'custom', editoptions: {
custom_element: editBrandFormatter,
dataInit: function () { AutocompleteBrand(); }
}
},

{
name: 'Model', index: 'Model', editable: true, searchoptions: { sopt: ['cn'], clearSearch: false }, title: false,
edittype: 'custom', editoptions: {
custom_element: editModelFormatter,
dataInit: function () { AutocompleteModel(); }
}
},

{ name: 'CreatedBy', index: 'CreatedBy', searchoptions: { sopt: ['cn'], clearSearch: false }, title: false },
{
name: 'DateCreated', index: 'Email', searchoptions: { sopt: ['cn'], clearSearch: false }, title: false,
formatter: function (cellValue) { return cellValue!= null? ConvertJsonDateStringToString(cellValue, serverOffset):''; },
},
{ name: 'ModifiedBy', index: 'Telephone', searchoptions: { sopt: ['cn'], clearSearch: false }, title: false },
{
name: 'DateModified', index: 'MobilePhone', searchoptions: { sopt: ['cn'], clearSearch: false }, title: false,

formatter: function (cellValue) { return cellValue != null ? ConvertJsonDateStringToString(cellValue, serverOffset) : ''; },
},
{ name: 'Id', index: 'Id', searchoptions: { sopt: ['cn'], clearSearch: false }, title: false, formatter: manageProductFormatter }
],
pager: '#GridPager',
rowNum: 10,
rowList: [10, 20, 30, 40, 50, 75, 100],
viewrecords: true,
jsonReader: {
records: "records",
total: "total",
page: "page",
repeatitems: false,
id: "Id"
},
sortname: 'Id',
sortorder: 'asc',
loadui: 'block',
autowidth: true,
altclass: 'odd',
altRows: true,
postData: {
OemId: $("#hndOemId").val()
},
toppager: true
});

当我单击保存图标时发生错误,如下图所示: enter image description here

谢谢你们的帮助,伙计们。

最佳答案

或者您可以将 JavaScript 添加到您的页面

//fix for jqgrid 
//http://stackoverflow.com/questions/30795713/uncaught-typeerror-cannot-read-property-errcap-of-undefined
$.jgrid.getRegional = function(inst, param, def_val) {
try{
if (inst instanceof jQuery){
inst = inst.get(0);
}
}catch(e){}
var ret;
if(def_val !== undefined) {
return def_val;
}
if(inst.p && inst.p.regional && $.jgrid.regional) {
ret = $.jgrid.getAccessor( $.jgrid.regional[inst.p.regional] || {}, param);
}
if(ret === undefined ) {
ret = $.jgrid.getAccessor( $.jgrid, param);
}
return ret;
}

关于jquery - 未捕获的类型错误 : Cannot read property 'errcap' of undefined,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30795713/

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com