1
如何在Ext 4中恢復collapsiple面板的狀態?還原分機面板狀態
我用下面的,但它無法還原:
var panel = Ext.create('Ext.panel.Panel', {
id: 'panel',
stateful: true,
stateId: 'panelState',
stateEvents: ['collapse', 'expand'],
getState: function() {
Console.log('get state' + this.collapsed);
return {
collapsed: this.collapsed
}
},
applyState: function (state) {
Console.log('apply state' + this.collapsed);
if (state) {
Ext.apply(this, state);
}
},
saveState: function() {
Console.log('save state' + this.collapsed);
debugger;
var me = this,
id,
state;
if (me.stateful !== false) {
id = me.getStateId();
if (id) {
state = me.getState();
if (me.fireEvent('beforestatesave', me, state) !== false) {
Ext.state.Manager.set(id, state);
me.fireEvent('statesave', me, state);
}
}
}
},
height: 100,
border: false,
style: { zIndex: 100 },
});
saveUserPosition ??? getPosition也不被使用 – 2014-06-05 09:21:46