Hello Pure team,
Thanks a lot & i commend the efforts behind the templating engine. I
just love the speed at which it renders( i'm a big fan of compile &
render functions...) And also special thanks to Mic, for assisting me
out in previous queries in this forum.
I'm stuck at a point, in displaying the json data in a required style
at UI. < display two records in a row >
...
"languages":[
{"name":"English","class":"EN", "value":01},
{"name":"Chinese", "class":"CH", "value":02},
{"name":"Italian", "class":"IT", "value":03},
{"name":"Japanese", "class":"JPN", "value":04},
{"name":"French", "class":"FR", "value":05},
{"name":"German", "class":"DE", "value":06}
],
...
and i need to display in UI as two records in a row
English Chinese
Italian Japanese
French German
... ...
I guess i'm going wrong somewhere on the directives.
directive = {
'tbody' : 'data<-resultList',
'tbody tr' : 'language<-data.languages',
'tbody tr td[class]' : function(obj){ // to align left or right
var leftRight = (obj.pos % 2 == 0) ? 'left' : 'right';
console.log(" obj.pos : " + obj.pos + ", leftRight : " +
leftRight);
return leftRight;
},
'tbody tr td' : '
language.name',
};
I've pasted my entre code at
http://friendpaste.com/1a9VFdl9cnWkTwCfivlJnp
I can get one rowListing for a row, but i need two records in a row..
Am i going wrong with the basics..??? i believe it has to be
something with my directives definition.
Appreciate your help in advance..!
Thanks
Tom!