在Designer中设置我的网名相同MyGridExtJS的如何获得网格
在点击按钮的addRecord叫,其中行被attemting获取未定义的网格失败。
如何定义此MyGrid以便它引用面板中的网格?
Ext.define('MyApp.view.MyPanel', {
extend: 'MyApp.view.ui.MyPanel',
initComponent: function() {
var me = this;
me.callParent(arguments);
var button = me.down('button[text=Submit]');
button.on('click', me.onSubmitBtnClick, me);
},
addRecord: function(myRecordArray) {
var rows = grid.getStore().getRange(); // ERROR happens here
console.log(rows);
},
onSubmitBtnClick: function() {
this.addRecord(["ll", "kk", "mm"]);
}
});
Chrome的JavaScript调试器控制台 - >
Uncaught ReferenceError: grid is not defined
非常感谢你,我真的被卡在那里 – BAR 2012-01-15 04:39:21