Javascript Ext.JS TypeError R是未定义的TypeError
我需要将本地js文件中定义的数据加载到GridPanel的对象中。经过多次尝试,我决定在存储标记中包含一个代理,但现在我收到一个错误,表明“r未定义”。我不完全确定这意味着什么,希望您能帮助我理解这个错误的含义,以及如何解决这个问题。为了帮助您理解我的意思,我在下面提供了一个指向包含代码的JSFIDLE的链接 到目前为止,我无法使用Ext.fly或Ext.getCmp一致地获取页面上的gridPanel实例或store对象。我还没有看到数据加载到网格中。在这一点上,我真的非常感谢您的帮助Javascript Ext.JS TypeError R是未定义的TypeError,javascript,html,extjs,extjs4.2,Javascript,Html,Extjs,Extjs4.2,我需要将本地js文件中定义的数据加载到GridPanel的对象中。经过多次尝试,我决定在存储标记中包含一个代理,但现在我收到一个错误,表明“r未定义”。我不完全确定这意味着什么,希望您能帮助我理解这个错误的含义,以及如何解决这个问题。为了帮助您理解我的意思,我在下面提供了一个指向包含代码的JSFIDLE的链接 到目前为止,我无法使用Ext.fly或Ext.getCmp一致地获取页面上的gridPanel实例或store对象。我还没有看到数据加载到网格中。在这一点上,我真的非常感谢您的帮助
loadGridStoreTestData: function (dataRec) {
var grid = Ext.fly(document.getElementByName("gridPanelClientId"));
if (!grid || grid === 'undefined') {
Ext.fly('errormessage').insertHtml('afterBegin', 'No GridPanel Object found here.');
} else {
Ext.fly('logger').appendChild(document.createTextNode(' 1. gridPanel found. Proceeding to get the Store object.\n'));
grid.on({
'viewready': { fn: this.onViewReadyHandler, scope: this },
'beforeshow': { fn: this.onBeforeShowHandler, scope: this }
//, 'exception': { fn: this.onExceptionHandler, scope: this }
});
var store = grid.getStore();
Ext.fly('logger').appendChild(document.createTextNode('2. gridPanel store accessed.\n'));
if (!store || store === 'undefined') {
Ext.fly('logger').appendChild(document.createTextNode('3. Store not found .\n'));
if (grid.hasChildNodes) {
var children = Array.prototype.slice.call(grid.ChildNodes);
if (children) {
for (var node in children) {
if (typeof (node) === typeof (new Ext.data.Store())) {
store = node;
}
}
}
}
}
if (store) {
store.on({
'datachanged': { fn: this.onStoreDataChangedHandler, scope: this },
'add': { fn: this.onStoreAddHandler, scope: this },
'load': { fn: this.onStoreLoadHandler, scope: this },
'update': { fn: this.onStoreUpdateHandler, scope: this },
'beforefetch': { fn: this.onStoreBeforeFetchHandler, scope: this },
'remove': { fn: this.onStoreRemoveHandler, scope: this },
// 'exception': { fn: this.onStoreExceptionHandler, scope: this },
'clear': { fn: this.onStoreClearHandler, scope: this }
});
grid.store.loadData(dataRec);
}
else {
Ext.fly('errormessage').insertHtml('afterBegin', 'no store configured for the current Grid instance');
}
}
}//,
提前感谢您似乎正在尝试使用
Ext.NET
。它在哪里?