When using select editor, the select element is unworkable(there is no select in grid), would you like to check my code to find problem?
$(function () {
//optional function used to create pqSelect and auto open it.
function initSelect(ui) {
ui.$cell.find("select").pqSelect();
setTimeout(function () {
ui.$cell.find("select").pqSelect('open');
})
}
var colModel = [
{ title: "ID", width: 100, dataIndx: "id", editable: false },
{ title: "Unit", dataIndx: "goodsUnit", width: 120,
editor: {
type: "select",
init: initSelect,
options: []
},
validations: [
{ type: 'minLen', value: 1, msg: "Required" }
]
},
{ title: "Name", dataIndx: "name", editable: false },
{ title: "Price", dataIndx: "price", width: 110 }
];
var dataModel = {
dataType: "JSON",
location: "remote",
method: "GET",
url: "/demo/jbolttable/normalEditable5Datas"
}
$("div#grid_editing").pqGrid({
colModel: colModel,
create: function (evt, ui) {
var grid = this,
column;
//fetch options for ShipCountry column from server.
$.getJSON("/admin/dictionary/datas?typeId=1&keywords=", function (response) {
column = grid.getColumn({ dataIndx: 'goodsUnit' });
column.editor.options = response;
});
},
dataModel: dataModel,
editModel: {
saveKey: $.ui.keyCode.ENTER,
keyUpDown: false,
clicksToEdit: 1
},
historyModel: { checkEditable: false },
numberCell: { show: false },
resizable: true,
scrollModel: { autoFit: true },
showBottom: false,
title: "Shipping Orders <b>(Custom editing)</b>"
});
});
Here is the error log:
pqgrid.min.js:19 Uncaught TypeError: Cannot read properties of undefined (reading '0')
at t.<computed>.<computed>.<anonymous> (pqgrid.min.js:19)
at n (pqgrid.min.js:9)
at t.<computed>.<computed>.e._trigger (pqgrid.min.js:9)
at t.<computed>.<computed>.a.quitEditMode (pqgrid.min.js:11)
at t.<computed>.<computed>.a._editCell (pqgrid.min.js:11)
at t.<computed>.<computed>.<anonymous> (pqgrid.min.js:11)
at pqgrid.min.js:10
at pq.cRenderBody.scrollXY (pqgrid.min.js:20)
at pq.cRenderBody.scrollCell (pqgrid.min.js:20)
at t.<computed>.<computed>.a.scrollCell (pqgrid.min.js:10)
(anonymous) @ pqgrid.min.js:19
n @ pqgrid.min.js:9
e._trigger @ pqgrid.min.js:9
a.quitEditMode @ pqgrid.min.js:11
a._editCell @ pqgrid.min.js:11
(anonymous) @ pqgrid.min.js:11
(anonymous) @ pqgrid.min.js:10
scrollXY @ pqgrid.min.js:20
scrollCell @ pqgrid.min.js:20
a.scrollCell @ pqgrid.min.js:10
a.editCell @ pqgrid.min.js:11
a._onClickCell @ pqgrid.min.js:10
(anonymous) @ pqgrid.min.js:10
dispatch @ jquery.min.js:2
y.handle @ jquery.min.js:2
Show 15 more frames
pqgrid.min.js:12 Uncaught TypeError: pq.getFn(...).call is not a function
at t.<computed>.<computed>.i.callFn (pqgrid.min.js:12)
at t.<computed>.<computed>.a._editCell (pqgrid.min.js:11)
at t.<computed>.<computed>.<anonymous> (pqgrid.min.js:11)
at pqgrid.min.js:10
at pq.cRenderBody.scrollXY (pqgrid.min.js:20)
at pq.cRenderBody.scrollCell (pqgrid.min.js:20)
at t.<computed>.<computed>.a.scrollCell (pqgrid.min.js:10)
at t.<computed>.<computed>.a.editCell (pqgrid.min.js:11)
at t.<computed>.<computed>.a._onClickCell (pqgrid.min.js:10)
at HTMLDivElement.<anonymous> (pqgrid.min.js:10)
i.callFn @ pqgrid.min.js:12
a._editCell @ pqgrid.min.js:11
(anonymous) @ pqgrid.min.js:11
(anonymous) @ pqgrid.min.js:10
scrollXY @ pqgrid.min.js:20
scrollCell @ pqgrid.min.js:20
a.scrollCell @ pqgrid.min.js:10
a.editCell @ pqgrid.min.js:11
a._onClickCell @ pqgrid.min.js:10
(anonymous) @ pqgrid.min.js:10
dispatch @ jquery.min.js:2
y.handle @ jquery.min.js:2
Show 12 more frames
pqgrid.min.js:11 Uncaught TypeError: Cannot read properties of undefined (reading 'focus')
at t.<computed>.<computed>.a._editCell (pqgrid.min.js:11)
at t.<computed>.<computed>.<anonymous> (pqgrid.min.js:11)
at pqgrid.min.js:10
at pq.cRenderBody.scrollXY (pqgrid.min.js:20)
at pq.cRenderBody.scrollCell (pqgrid.min.js:20)
at t.<computed>.<computed>.a.scrollCell (pqgrid.min.js:10)
at t.<computed>.<computed>.a.editCell (pqgrid.min.js:11)
at t.<computed>.<computed>.a._onClickCell (pqgrid.min.js:10)
at HTMLDivElement.<anonymous> (pqgrid.min.js:10)
at HTMLDivElement.dispatch (jquery.min.js:2)
a._editCell @ pqgrid.min.js:11
(anonymous) @ pqgrid.min.js:11
(anonymous) @ pqgrid.min.js:10
scrollXY @ pqgrid.min.js:20
scrollCell @ pqgrid.min.js:20
a.scrollCell @ pqgrid.min.js:10
a.editCell @ pqgrid.min.js:11
a._onClickCell @ pqgrid.min.js:10
(anonymous) @ pqgrid.min.js:10
dispatch @ jquery.min.js:2
y.handle @ jquery.min.js:2
Show 11 more frames
pqgrid.min.js:11 Uncaught TypeError: Cannot read properties of undefined (reading 'focus')
at t.<computed>.<computed>.a._editCell (pqgrid.min.js:11)
at t.<computed>.<computed>.<anonymous> (pqgrid.min.js:11)
at pqgrid.min.js:10
at pq.cRenderBody.scrollXY (pqgrid.min.js:20)
at pq.cRenderBody.scrollCell (pqgrid.min.js:20)
at t.<computed>.<computed>.a.scrollCell (pqgrid.min.js:10)
at t.<computed>.<computed>.a.editCell (pqgrid.min.js:11)
at t.<computed>.<computed>.a._onClickCell (pqgrid.min.js:10)
at HTMLDivElement.<anonymous> (pqgrid.min.js:10)
at HTMLDivElement.dispatch (jquery.min.js:2)
a._editCell @ pqgrid.min.js:11
(anonymous) @ pqgrid.min.js:11
(anonymous) @ pqgrid.min.js:10
scrollXY @ pqgrid.min.js:20
scrollCell @ pqgrid.min.js:20
a.scrollCell @ pqgrid.min.js:10
a.editCell @ pqgrid.min.js:11
a._onClickCell @ pqgrid.min.js:10
(anonymous) @ pqgrid.min.js:10
dispatch @ jquery.min.js:2
y.handle @ jquery.min.js:2
Show 11 more frames