PDA

View Full Version : Dataview itemSelector pointing to child element



sarasa
25 Sep 2013, 5:24 AM
I want to use dataview to render the following hierarchy data:

"name":"Text1",
"enabled":true,
"criteria":[
{
...
}
],
"rules":[
{
"name":"Block",
"criteria":[
{
name:''
},
{
....

},

]
},
{
"name":"Allow",
"criteria":[]
}
],

[CODE] '<tpl for=".">',
'<tpl for="rules">',
'<tpl for="criteria">',
'<div class="object">{name}</div>',
'</tpl>',
'</tpl>',
'</tpl>',
[/CODE
itemSelector: 'div.object'' is not working!
It throws error!!!
Is it possible at all to support itemSelector which point to children element instead of root level?

ettavolt
27 Sep 2013, 11:19 AM
No.
You should flatten you object tree same way Ext.data.NodeStore does for Ext.data.TreeStore.
However, if you only need to show without receiving interaction from user, you should consider a Component with tpl - it does not use itemSelector.