-
23 Nov 2012 1:51 AM #1
Unanswered: Ext Template for question
Unanswered: Ext Template for question
Hi all,
I wish display a key value in my JSON Object, there is a example
{key} returns empty.
My Ext Template :
Code:<tpl for="kids"> {key} : <tpl for="kids.key"> {name} </tpl> </tpl>
My Json Object :
Code:{ 'kids' : { 'Boys' : { 'name': 'Georges' } } }
I've tried everything, but i can't display the value {key} ( here, Boys ).
I've looking in docs and post topics, but no solutions is available
Any Help ?
Regards
-
23 Nov 2012 2:01 AM #2
Wouldn't that just be {Boys} instead of {key} in your tpl?
-
23 Nov 2012 2:22 AM #3
My JSON Object is more complex, sometimes it's 'Boys' sometimes it's 'Girls'
I need the key's dynamic value.
-
23 Nov 2012 2:26 AM #4
How the tpl works is that it tries to match whatever is in {...} (in the tpl) with the data object being passed to it, so you may have to define {Boys} and {Girls} in the tpl then.


Reply With Quote