Just add this plugin (just 1 ajax loaded edited grid/ext3) & notice strange behaviour, in some cases.
Sometimes it load saved columns positions, sometimes - no. In chrome it mostly works, in Firefox - mostly not loads (~10% of reloads - show saved previously columns orders/hidden state/etc).
Seems its cause stored data is loaded after grid. And i know that author recommends use this inline in main html.
i dont try this yet, cause have large system, and this will take me many time to redo this way, so am loading as :
Code:
var cp = new Ext.ux.state.HttpProvider(
{
url:'asset_tracker_grid.php?act=handle-state'
,user:'{/literal}{$active_user}{literal}'
,session:'Perseus.Stat'
,id:'1'
,readBaseParams:{cmd:'read_state'}
,saveBaseParams:{cmd:'save_state'}
,autoRead:false
,logFailure:true
,logSuccess:true
}
);
Ext.state.Manager.setProvider( cp );
$.post(
"asset_tracker_grid.php?act=handle-state-get",
{
},
function(ret) {
Ext.state.Manager.getProvider().initState(ret.data); //[{"name":"client-mod-client-grid","value":"..."},{"name":"client-mod-win","value":"..."}]
},
'json'
);
But am interested, if this possible - to reload grid, with new state? I.e. somehow
1. load state
2. grid.redraw()
with js, as ex, button pressed -> grid state reloaded.
Or maybe is possible add state loading on some event of grid, i.e. before show all grid in page?
Can your help me pls...