PDA

View Full Version : reload a store



noog
15 Nov 2010, 3:52 AM
hello,
i want to reload / refresh a dao store after updating a form
this is the way my store is created

ConfigDoc = Ext.extend(Ext.data.JsonStore, {
constructor: function(cfg) {
cfg = cfg || {};
ConfigDoc.superclass.constructor.call(this, Ext.apply({
storeId: 'StoreDoc',
url: 'read.php',
root: 'data',
autoLoad: true,
fields: [
{
name: 'id',
mapping: 'id'
},
(...)
}
]
}, cfg));
}
});
new ConfigDoc();

and the this is the button function to update


MyToolbarUi3 = Ext.extend(Ext.Toolbar, {
initComponent: function() {
this.items = [
{
xtype: 'buttongroup',
columns: 2,
items: [
{
xtype: 'button',
cls : 'x-btn-icon',
icon : 'images/icons/disk.png',
handler : function () {
//Ext.Msg.alert('Boo', 'here i am');
Ext.getCmp('workspace').getForm().submit();
//Ext.getCmp('StoreConfig').getStore().reload();
// ConfigStore.load();
ConfigDoc.StoreDoc.reload();

}
}
]
}
];
MyToolbarUi3.superclass.initComponent.call(this);
}
});

i try to call the store like this

StoreDoc.reload();

but the response is storedoc is undefined
so how can i retrieve the id of my store ?
thks for your help