Sep 13, 2011, 3:52 PM
Create GridPanel \ Store from configuration string (reverse of .ToConfig)
For a dynamic UI project that is being built, we are looking into being able to persist the configuration of GridPanels and the related Stores (without data) in a database. The desired solution would be to be able to store these configurations as strings. There is a very clear "ToConfig" method on both the Store and the GridPanel, but it is unclear on how to create a Store or GridPanel from the persisted strings that come out of the .ToConfig methods. We've been unable to find anything in the forums relating to this type of "rehydration" from a string, the dynamic samples use For loops to create Store RecordFields \ GridPanel Columns.
Can somebody point us in the right direction on how to do this? Below are the string configurations from the .ToConfig methods of the sample Store and sample GridPanel that we are using.
Thanks in advance for any assistance that can be provided.
Can somebody point us in the right direction on how to do this? Below are the string configurations from the .ToConfig methods of the sample Store and sample GridPanel that we are using.
Thanks in advance for any assistance that can be provided.
{proxyId:"Store1",autoLoad:true,reader:new Ext.data.JsonReader({fields:[{name:"Col1"},{name:"Col2"},{name:"Col3"},{name:"Col4"}]}),directEventConfig:{},proxy:new Ext.data.PagingMemoryProxy({})}
{store:this.Store1=new Ext.ux.data.PagingStore({proxyId:"Store1",autoLoad:true,reader:new Ext.data.JsonReader({fields:[{name:"Col1"},{name:"Col2"},{name:"Col3"},{name:"Col4"}]}),directEventConfig:{},proxy:new Ext.data.PagingMemoryProxy({})});,id:"419ade80_5970_45e0_be14_7286f542f0fb",xtype:"netgrid",fieldLabel:"GridPanel Test",height:200,selectionMemory:false,cm:this.id5b1d8f92285a4abbad5e53248d01d5f1=new Ext.grid.ColumnModel({proxyId:"",columns:[{dataIndex:"Col1",header:"Col1 Hdr",id:"Col1"},{dataIndex:"Col2",header:"Col2 Hdr",id:"Col2",width:125},{dataIndex:"Col3",header:"Col3 Hdr",id:"Col3",width:150},{dataIndex:"Col4",header:"Col4 Hdr",id:"Col4",width:200}]})}