how to setupdata for enyo repeater inside repeater ? i.e multiple repeater inside same loop

hello everybody can you please provide me some logic that about repeater inside repeater so that i can populate data instatly .
{kind: "enyo.Repeater", name: "DynamicCategoriesRepeater", ontap:"setupitem", onSetupItem: "DynamicCategoriesRepeaterSetUp", classes: "enyo-fill", components: [
{kind: "moon.ContextualPopupDecorator", name: "CategoriesPopup", components: [
{name: "Categories", content:"", small:true},
{kind: "moon.ContextualPopup", classes:"sub-menu", components: [
// {classes:"items", kind: "moon.Item"},
{classes: "moon-16v items", components: [
{kind: "moon.Scroller", classes: "enyo-fill", components: [
{kind: "enyo.Repeater", name: "CategoriesContentRepeater", onSetupItem: "CategoriesContentRepeaterSetUp", classes: "enyo-fill", components: [
{kind: "moon.Item", name: "CategoriesContentDynamic", ontap: "PlayChannel", components: [
{name: "CategoriesContentDynamicLogo", classes:"channel-logo", tag: "img", src: "https://www.worldtvgo.com/resources/logo/VT_TV_1_mono.png"},
{name: "CategoriesContentDynamicName", classes:"channel-name", content:"TestLogo"}
]},
]}
]}

]}
]}
]},
]}
This is my code and beth below is my functions:
DynamicCategoriesRepeaterSetUp: function(inSender, inEvent){
index =inEvent.index;
if(inEvent.item.$.CategoriesContentRepeater){
categories = JSON.parse(localStorage.getItem("categories"));
inEvent.item.$.Categories.setContent(categories[index].genre.genreName +"(" + categories[index].channelList.length + ")");
inEvent.item.$.CategoriesContentRepeater.setCount(categories[index].channelList.length);
}
},
CategoriesContentRepeaterSetUp: function(inSender, inEvent){
i = inEvent.index;
console.log(i);
// console.log(inEvent.indices);
categories = JSON.parse(localStorage.getItem("categories"));
if((inEvent.indices)){
for(var j= 0; j<categories.length; j++){
if((inEvent.indices)[1] == j){
// console.log((inEvent.indices)[1]);
for(var k =0; k<categories[j].channelList.length; k++){
// console.log
inEvent.item.$.CategoriesContentDynamicName.setContent(categories[j].channelList[k].channelName);
inEvent.item.$.CategoriesContentDynamicLogo.setSrc(categories[j].channelList[k].logo);
// console.log(categories[j].channelList[k].channelName);
}
}
}
}
}

my first repeater is working fine and my second repeater also works but my data was from JSON array format and second time it only repeats data that is from last of my array list so that i cannt work my tv applications so what may be the possible solutions for working it effectively and efficiently.

Here may be stacks of developers working on enyo js and have helping for help stackers so please have a look on this issues if not possible for solving this task there may be many alternative solutions too.
So thank you all in advance

Comments

  • Nesting repeaters can be tricky. The number on thing to keep in mind is that you don't let the events bubble out from the inner repeater to the outer repeater. I can't provide a lot more help without a fiddle that shows the problem. I'm not entirely positive we even supported nested repeaters.
  • Thank you for your comment i will provide you fiddle
Sign In or Register to comment.