我的桌面上有一个工具栏。我还在桌面上有一个按钮,用于显示和隐藏此工具栏。目前我有额外的按钮隐藏在工具栏本身中,它的工作正常。如果我隐藏它,工具栏将完全初始化,panel1.object(见下面的代码)如下所示:
activeUI: "default" autoGenId: true body: constructor collapseDirection: "top" componentCls: "x-panel" componentLayout: constructor componentLayoutCounter: 2 container: constructor dd: constructor dock: "top" dockedItems: constructor el: constructor events: Object floatingItems: constructor frame: undefined hasListeners: HasListeners height: 35 hidden: true hiddenByLayout: null hiddenOnCollapse: constructor hierarchyState: Object hierarchyStateInner: Object id: "TESTtoolbarX-1034" initialConfig: Object initialStyle: Object items: constructor lastBox: Object layout: constructor layoutCounter: 2 loader: null margin$: Object ownerCt: constructor ownerLayout: constructor plugins: undefined pluginsInitialized: true protoEl: null renderData: Object renderSelectors: Object rendered: true rendering: null scrollFlags: Object stateEvents: Array[0] stateId: undefined tools: Array[0] ui: "default" uiCls: Array[1] x: 0 y: 0 __proto__: Object
如果我想用桌面上的外部按钮显示我的工具栏,我的 panel1.object 会短得多。
autoGenId: true
collapseDirection: "top"
componentCls: "x-panel"
componentLayout: constructor
dockedItems: constructor
events: Object
floatingItems: constructor
hasListeners: HasListeners
height: 35
hiddenOnCollapse: constructor
id: "TESTtoolbarX-1067"
initialConfig: Object
initialStyle: Object
items: constructor
layout: constructor
loader: null
plugins: undefined
pluginsInitialized: true
protoEl: constructor
renderData: Object
renderSelectors: Object
stateEvents: Array[0]
stateId: undefined
__proto__: Object
我试图这样展示它(来自控制器的代码):
onShowToolbar: function() {
debugger;
var panel1 = Ext.create('TEST.view.desktop.Toolbar', { maxWidth: 360, height: 35 });
panel1.show();},
我怎样才能正确显示这个*工具栏?请帮忙!