PDA

View Full Version : adding ScriptTagProxy ?



franklt69
15 Sep 2010, 11:26 AM
Hi how is possible using the designer to add a

proxy: new Ext.data.ScriptTagProxy({
url: 'http://localhost:2258/SimpleScriptPageProxy.aspx/GetPeople'
}),

inside the a Ext.data.JsonStore

I mean i want something like it:




MyStore = Ext.extend(Ext.data.JsonStore, {
constructor: function(cfg) {
cfg = cfg || {};
MyStore.superclass.constructor.call(this, Ext.apply({
storeId: 'MyStore',
autoLoad: true,
root: 'd',
idProperty: 'Id',

proxy: new Ext.data.ScriptTagProxy({
url: 'http://localhost:2258/SimpleScriptPageProxy.aspx/GetPeople'
}),
fields: [
{
name: 'Id'
},
{
name: 'FirstName'
},
{
name: 'LastName'
},
{
name: 'BirthDate'
}
]
}, cfg));
}
});
new MyStore();


regards
Frank

jarrednicholls
15 Sep 2010, 11:40 AM
Hi Frank,

Unfortunately this is not possible via the interface at this time. We are working on more customizable Store configuration.

If you are done modifying your store, you can take the exported .js file and copy it to a new file that won't be overwritten on each project export...then reference that new file in your project code rather than the original. Then you can modify it as you have exampled above.

We are also going to be adding an option to flag off and on the automatic instantiation of Store classes. So the "new MyStore();" line will be able to be toggled on/off in the future. Then you can do things like:



new MyStore({
proxy: new Ext.data.ScriptTagProxy()
});


to override your base configuration.