0

I have a kind called RobustList, which extends Control, and it has these components:

components: [
    {name: "outerScroll",kind: "Scroller",touch: true,classes: "enyo-fit",components: [
            {name: "list",kind: "Repeater",onSetupItem: "setupItem",components: [
                    {name: "item",components: [
                            {name: "index",style: "display:none;"}
                    ]}, 
                    {name: "empty",fit: true,content: ""}, 
                    {name: "loadmore",fit: true,content: "Load More Items"}
                ]}
        ]}

]

Now I am catching the onSetupItem event, and in that function I am trying to access the children component. I am having a problem though. I was under the assumption that saying this.$ gave me access to all of the children component. Its currently only giving me access to outerscroll and list. Why is that?

Edit


Ok so apparently when using the List kind I can access all the children components (specifically in the create enyo function I am overriding). I'm very confused as to when its appropriate to do certain things. Like I assumed this.$ could be used everywhere. This is definitely not the case.

4

2 に答える 2

0
setupItem:function(inSender,inEvent){
    var data = this.data;
    if(data){
        var item = inEvent.item;
        var row = data[inEvent.index];
        item.$.loadmore.set('content',row.content);
    }
},
于 2016-03-07T08:52:13.087 に答える