0
我想在JQGrid中編輯單元格時使用datepicker。當我在單元格單擊它並更改爲文本框和日期選擇器會顯示,但是選擇一個日期後,我收到以下錯誤拋出Jquery UI DatePicker在JQGrid
Microsoft JScript runtime error: Missing instance data for this datepicker
下面是jqGrid的
var saverow = 0;
var savecol = 0;
$("#requestTable").jqGrid({
url: url,
datatype: 'json',
mtype: 'GET',
altRows: 'true',
colNames: ['id', 'Request Date', 'Name', 'HomePhone', 'Address', 'Contact Date(edit)', 'Email'],
colModel: [
{ name: 'Id', index: 'Id', hidden: true },
{ name: 'RequestDate', index: 'RequestDate', width: 100 },
{ name: 'FullName', index: 'FullName', width: 125, sortable: false },
{ name: 'HomePhone', index: 'CabinetColor', width: 90, sortable: false },
{ name: 'FullAddressString', index: 'ShellColor', width: 260, sortable: false },
{ name: 'DealerContactDate', index: 'DealerContactDate', width: 105, editable: true,
editoptions: {
dataInit: function (element) {
$(element).blur(function() {
$("#requestTable").jqGrid("saveCell", saverow, savecol);
$("#requestTable").jqGrid("restoreCell", saverow, savecol);
$("#requestTable").trigger("reloadGrid");
});
$(element).datepicker({
onSelect: function (dateText, inst) {
$("#requestTable").jqGrid("saveCell", saverow, savecol);
}
});
}
}
},
{ name: 'Email', index: 'Email', width: 110, sortable: false }
],
cellEdit: true,
pager: '#pager',
rowNum: 50,
rowList: [25, 50, 75, 100],
sortname: 'id',
sortorder: "desc",
viewrecords: true,
height: "100%",
cellurl: cellurl,
afterEditCell: function (id, name, val, IRow, ICol) {
saverow = IRow;
savecol = ICol;
}
});
代碼
任何想法,爲什麼我得到這個錯誤? 謝謝!