-
5 Jan 2013 1:59 AM #1
Can not able to load json data in Sencha touch 2.1 Accordionlist
Can not able to load json data in Sencha touch 2.1 Accordionlist
Hi
I had tried more time to load the treestore data into the AccordianList from json. I got json data in correct format but accordian is not showing the data. i think the proxy in treestore is not supporting to accordian. Anyway i need to do this. its very urgent for me. Can anyone guide me i give special thanks you for you guys
-
7 Jan 2013 11:55 AM #2
I'm going to assume that you mean NestedList when you refer to the AccordionList.
http://docs.sencha.com/touch/2-1/#!/...iew.NestedList
Have you added a JsonTreeStore? Added a relevant JSON file that you are loading? Bound the NestedList to the tree that you created?Aaron Conran
@aconran
Sencha Architect Development Team
-
7 Jan 2013 8:28 PM #3
Hi acon
Nested list is suitable for this i have not problem to use nested list. But my requirement is collapsible list with in the single view and not consider more views like in nested list. Here i took one sample for acordian list but it was not loading the data from json it should be load the data as static. But now my friend premkumar just customize the proxy function and load the data from the json. My problem is solved now. You can got the examble from this post http://www.sencha.com/forum/showthread.php?252752-CollapsibleList-in-Sencha-2.1
and customize the proxy functions are OnProxyLoad, OnNodeBeforeExpand. You need to put this code inside the store
onProxyLoad: function(operation) {
var me = this,
records = operation.getRecords(),
successful = operation.wasSuccessful(),
node = operation.getNode();
node.beginEdit();
node.set('loading', false);
if (successful) {
records = me.fillNode(node, records);
}
node.endEdit();
this.updateNode(node);
me.loading = false;
me.loaded = true;
node.fireEvent('load', node, records, successful);
me.fireEvent('load', this, records, successful, operation);
//this is a callback that would have been passed to the 'read' function and is optional
Ext.callback(operation.getCallback(), operation.getScope() || me, [records, operation, successful]);
},
onNodeBeforeExpand: function(node, options, e) {
},
-
23 Apr 2013 6:18 AM #4
Works like a Charm
Works like a Charm
Thanks very much!!!

Submitted patch to original AuthorCode:{ "items" : [{ "text" : "Default", "items" : [{ "text" : "Eat", "leaf" : true }, { "text" : "Sleep", "leaf" : true }, { "text" : "Drinking", "leaf" : true }] }, { "text" : "VIP", "items" : [{ "text" : "Watch TV", "leaf" : true }, { "text" : "Watch Video", "leaf" : true }] }, { "text" : "Group-1", "items" : [{ "text" : "Shopping", "leaf" : true }] }, { "text" : "Group-2", "items" : [{ "text" : "Eat", "leaf" : true }, { "text" : "Sleep", "leaf" : true }, { "text" : "Drinking", "leaf" : true }] }] }
https://github.com/kawanoshinobu/Ext.ux.AccordionList


Reply With Quote