【发布时间】:2022-06-14 06:11:52
【问题描述】:
更新商店时无法读取 null 的属性(读取 'insertAdjacentHTML')。
我正在尝试通过更改一些数据来手动更新我的商店。
这是我的代码。
updateFieldData: function (selectedDRecord) {
if (selectedDRecord.id != undefined || selectedDRecord.id != null) {
let _this = this;
let groupkey = sessionStorage.getItem('groupKey');
var rowExapnaderGridData = Ext.ComponentQuery.query('#' + groupkey)[0].getStore(); // this is my gridstore
var tempStore = [];
var salesRowData = rowExapnaderGridData.getData().items;
for (var i = 0; i < salesRowData.length; i++) {
tempStore.push(salesRowData[i].data);
}
for (var i = 0; i < tempStore.length; i++) {
tempStore[i].value = "somevalue";
}
rowExapnaderGridData.loadData(tempStore);
}
},
这在创建时工作正常,但在我更新时出现以下错误。
Uncaught TypeError: Cannot read properties of null (reading 'insertAdjacentHTML')
at ctor.insertHtml (ext-all.js?_dc=1654269040829:20:911890)
at ctor.doInsert (ext-all.js?_dc=1654269040829:20:481469)
at ctor.append (ext-all.js?_dc=1654269040829:20:481393)
at ctor.refresh (ext-all.js?_dc=1654269040829:20:1600777)
at ctor.refresh (ext-all.js?_dc=1654269040829:20:1619324)
at ctor.refresh (ext-all.js?_dc=1654269040829:20:1862004)
at ctor.refreshView (ext-all.js?_dc=1654269040829:20:1609433)
at ctor.onDataRefresh (ext-all.js?_dc=1654269040829:20:1609149)
at ctor.onDataRefresh (ext-all.js?_dc=1654269040829:20:1870226)
at ctor.fire (ext-all.js?_dc=1654269040829:20:153709)
我在其他地方检查过,但没有得到太多 w.r.t.ExtJS 的支持。
【问题讨论】:
标签: javascript html extjs