ChillsNL
18 Apr 2011, 12:30 AM
Hello people, good morning.
I've worked my ass of friday to create an Ext.Data.Treestore. It is a kind of familiar with the demo of kitchensink. I've got another problem with loading data from a webservice into this Store. As this examples shows, all the links are hardcoded. Now i need to adjust the Store and model so it loads the data in mylist.js and put the links in the list.
FWM.Structure =
[{
text: 'User Interface',
source: 'list.js',
cls: 'launchscreen',
card: Ext.is.Phone ? false : GW.List,
items:
[{
text: 'Dossiers',
card: GW.Dossier,
source: 'dossier.js',
leaf: true
},
{
text: 'List',
card: GW.List,
source: 'list.js',
leaf: true
}]
}];
Ext.regModel
('myMobile',
{
fields:
[
{name: 'text', type: 'string'},
{name: 'source', type: 'string'},
{name: 'card'}
]
}
);
FWM.StructureStore = new Ext.data.TreeStore
(
{
model: 'myMobile',
root:
{
items: FWM.Structure
},
proxy:
{
type: 'ajax',
reader:
{
type: 'tree',
root: 'items'
}
}
}
);
{
"MyLists": [
{
"text": "User Interface",
"source": "list.js",
"items": "[]",
"card": "Ext.is.Phone ? false : GW.List"
},
{
"text": "Dossier",
"source": "dossier.js",
"items": "[]",
"card": "Ext.is.Phone ? false : GW.Dossier"
}
]
}
So the question is, is there someone willing to help me? It's important cause it's for my school project and got 6 weeks left. Really need some help.
Thnx!
I've worked my ass of friday to create an Ext.Data.Treestore. It is a kind of familiar with the demo of kitchensink. I've got another problem with loading data from a webservice into this Store. As this examples shows, all the links are hardcoded. Now i need to adjust the Store and model so it loads the data in mylist.js and put the links in the list.
FWM.Structure =
[{
text: 'User Interface',
source: 'list.js',
cls: 'launchscreen',
card: Ext.is.Phone ? false : GW.List,
items:
[{
text: 'Dossiers',
card: GW.Dossier,
source: 'dossier.js',
leaf: true
},
{
text: 'List',
card: GW.List,
source: 'list.js',
leaf: true
}]
}];
Ext.regModel
('myMobile',
{
fields:
[
{name: 'text', type: 'string'},
{name: 'source', type: 'string'},
{name: 'card'}
]
}
);
FWM.StructureStore = new Ext.data.TreeStore
(
{
model: 'myMobile',
root:
{
items: FWM.Structure
},
proxy:
{
type: 'ajax',
reader:
{
type: 'tree',
root: 'items'
}
}
}
);
{
"MyLists": [
{
"text": "User Interface",
"source": "list.js",
"items": "[]",
"card": "Ext.is.Phone ? false : GW.List"
},
{
"text": "Dossier",
"source": "dossier.js",
"items": "[]",
"card": "Ext.is.Phone ? false : GW.Dossier"
}
]
}
So the question is, is there someone willing to help me? It's important cause it's for my school project and got 6 weeks left. Really need some help.
Thnx!