-
9 Oct 2011 11:24 PM #1
Answered: Accessing ChildNode data in Nested List
Answered: Accessing ChildNode data in Nested List
Hi,
I have a nested list component that is structured as follows :
As of now Im using the Ext.Nested list component to navigate thru the list as so : Parent1>Child1>detailCard etcCode:{ "items":[ { "text": "Parent 1", "leaf": false, "items": [ { "text": "Child 1", "leaf" : true }, { "text": "Child 2", "leaf" : true }, { "text": "Child 3", "leaf" : true }, ] }, { "text": "Parent 2", "leaf": false, "items": [ { "text": "Child 1", "leaf" : true }, { "text": "Child 2", "leaf" : true }, { "text": "Child 3", "leaf" : true }, ] } ] }
However, I want to add a functionality such that : On clicking the Parent1 element in the list an alert should display how many Child objects it has in its items array.
How do I go about that ?
Thanks in advance
Sasha
-
Best Answer Posted by skirtle
This looks like a Sencha Touch question to me. This forum is for ExtJS 4. You may have more luck getting an answer in the Sencha Touch forum.
-
10 Oct 2011 9:56 PM #2
I should probably add that this is my store :
And this is my NestedListCode:bus_store = new Ext.data.TreeStore({ model: 'ListItem', //root: data, proxy: { type: 'ajax', url: 'data/routes.json', reader: { type: 'tree', root: 'items' } } });
Code:.......... BusView = Ext.extend(Ext.NestedList, { id: 'nestedList', title: 'Bus View', iconMask: true, ui: 'plain', iconCls: 'locate', fullscreen: true, store: bus_store, displayField: 'text', ...........
-
10 Oct 2011 11:48 PM #3
This looks like a Sencha Touch question to me. This forum is for ExtJS 4. You may have more luck getting an answer in the Sencha Touch forum.
-
11 Oct 2011 2:08 AM #4
Right... Sorry thats my mistake.... I'll go repost this in the Sencha Touch forum.
:P Sorry for the hassel


Reply With Quote