Hi there,
I am working with state handling, I have a tab panel and I want to store the tab when it changes, is there anything out of the box for this? Setting stateful to true, stateEvents : ['tabchange'] and stateId: 'myState' does not work. With "out of the box" I mean if this can be done without having to program the logic myself.
This is a very easy example that does not store anything in the Cookie:
Code:
Ext.onReady(function()
{
Ext.state.Manager.setProvider(new Ext.state.CookieProvider(
{
expires: new Date(new Date().getTime()+(1000*60*60*24*7)), //7 days from now
}));
Ext.tip.QuickTipManager.init();
Ext.create('Ext.container.Viewport',
{
layout: 'border',
items:
[
Ext.create('Ext.tab.Panel',
{
title : 'panel',
region: 'center',
stateId : 'tabpanelState',
stateful : true,
stateEvents : ['tabchange'],
items :
[
{
title : 'tab 1',
id : 'tab1',
html : '<div id="tab1">Some text here<br/>Some text here<br/>Some text here<br/>Some text here<br/>Some text here<br/></div>'
},
{
title : 'tab 2',
id : 'tab2',
html : '<div id="tab1">Some text here<br/>Some text here<br/>Some text here<br/>Some text here<br/>Some text here<br/></div>'
},
{
title : 'tab 3',
id : 'tab3',
html : '<div id="tab1">Some text here<br/>Some text here<br/>Some text here<br/>Some text here<br/>Some text here<br/></div>'
},
{
title : 'tab 4',
id : 'tab4',
html : '<div id="tab1">Some text here<br/>Some text here<br/>Some text here<br/>Some text here<br/>Some text here<br/></div>'
},
{
title : 'tab 5',
id : 'tab5',
html : '<div id="tab1">Some text here<br/>Some text here<br/>Some text here<br/>Some text here<br/>Some text here<br/></div>'
},
{
title : 'tab 6',
id : 'tab6',
html : '<div id="tab1">Some text here<br/>Some text here<br/>Some text here<br/>Some text here<br/>Some text here<br/></div>'
},
{
title : 'tab 7',
id : 'tab7',
html : '<div id="tab1">Some text here<br/>Some text here<br/>Some text here<br/>Some text here<br/>Some text here<br/></div>'
},
{
title : 'tab 8',
id : 'tab8',
html : '<div id="tab1">Some text here<br/>Some text here<br/>Some text here<br/>Some text here<br/>Some text here<br/></div>'
}
]
})
]
});
});
This is the resulting cookie:
cookie.png
The result of decoding that value (Ext.state.Manager.getProvider().decodeValue('o%3A')) is an empty Object. So nothing is stored.
What's the way to go with this?