PDA

View Full Version : Ext.data.TreeStore with Ext.data.LocalStorageProxy and Ext.data.ScriptTagProxy



agruenen
16 Feb 2011, 5:54 AM
Hello everyone,

I need to store data localy (Ext.data.LocalStorageProxy) which is remotly loaded by Ext.data.ScriptTagProxy.

I am able to load the data with Ext.data.ScriptTagProxy and to diplay it in a Ext.NestedList.
My problem is to transfer the data from one Ext.data.TreeStore to the other.

How can I add Nodes/Data from one TreeStore to the other and how will the Ext.NestedList show the items.

I thank you for every hints.

This is my try.... but Ext.NestedList is not updating.



// Seminarkategorien
app.stores.seminarkategorienRemote = new Ext.data.TreeStore({
model: 'seminare_kategorien',
proxy: {
type: 'scripttag',
url : 'http://hostorwhatever/seminar-kategorien.json',
reader: {
type: 'tree',
root: 'items'
}
},
autoLoad: false
});
app.stores.seminarkategorien =new Ext.data.TreeStore({
model: 'seminare_kategorien',
proxy: {
type: 'localstorage',
id:'seminarkategorien',
reader: {
type: 'json',
root: 'kategorien'
}
},
autoLoad: false
});
//-------- this part can be found in another function
app.stores.seminarkategorien.load();

if(!app.stores.seminarkategorien.getRootNode().hasChildNodes())
{
app.stores.seminarkategorienRemote.load({
callback:function(){

app.stores.seminarkategorien.tree.setRootNode(
app.stores.seminarkategorienRemote.getRootNode()
);
}
} );

}
//-------- this part can be found in another function

agruenen
16 Feb 2011, 11:21 PM
bump =;