我有以下看法:
Ext.define("FI.view.InstallBaseList", {
extend: 'Ext.grid.Panel',
require: 'FI.store.InstallBaseStore',
title: 'List',
alias: 'widget.installBaseList',
icon:'table.png',
store:'FI.store.InstallBaseStore',
columns: [],
divId:'',
dockedItems: [],
height: 200,
width: 700,
renderTo: "container",
enableLocking: true,
draggable: true,
resizable: true,
initComponent: function(config){
console.log("here");
}
});
这就是我尝试从控制器创建它的方式:
list = Ext.widget('installBaseList', params);
在浏览器中,我收到此错误:
me.dockedItems.insert is not a function
addDocked(items=[Object { xtype="header", title="List", titleAlign="left", more...}], pos=0) ext-all-debug.js (line 47051)
updateHeader(force=undefined) ext-all-debug.js (line 90398)
beforeRender() ext-all-debug.js (line 90275)
getRenderTree() ext-all-debug.js (line 26056)
render(container=Object { dom=div#container, id="container", $cache={...}, more...}, position=undefined) ext-all-debug.js (line 26193)
constructor(config=Object { divId="container", columns=[0]}) ext-all-debug.js (line 44380)
callParent(args=[Object { divId="container", columns=[0]}]) ext-all-debug.js (line 3728)
constructor(config=Object { divId="container", columns=[0]}) ext-all-debug.js (line 56387)
constructor () ext-all-debug.js (line 3892)
widget(name="installBaseList", config=Object { divId="container", columns=[0]}) ext-all-debug.js (line 5083)
(?)() ListCo...5323863 (line 98)
me.dockedItems.insert(pos + i, item); ext-all-debug.js (line 47051)
更重要的是,在initComponent
方法中,config
似乎是未定义的。为什么?
问题出在哪里?