I have the the repeater.js in which m getting the values on load.that is setupItem method..
I want to get the same value on click of an button..This problem m getting in case of both list and repeater...data are loading onload but on button its not working...can anyone help....
enyo.kind({
name: "enyo.sample.RepeaterSample",
classes: "enyo-fit repeater-sample",
components: [
{kind: "Repeater", onSetupItem:"setupItem", components: [
{name:"item", classes:"repeater-sample-item", components: [
{tag:"span", name: "personNumber"},
{tag:"span", name: "personName"}
]}
]},
//{kind: "onyx.Button", content:"Fetch", ontap:"setupItem"}
],
create: function() {
this.inherited(arguments);
this.$.repeater.setCount(this.people.length);
this.peopleChanged();
},
published: {
people: []
},
peopleChanged: function() {
for(var i=0;i < 5;i++){
this.people[i]="art "+i;
}
this.$.repeater.setCount(this.people.length);
},
setupItem: function(inSender, inEvent) {
var index = inEvent.index;
var item = inEvent.item;
alert(this.people[index]);
var person = this.people[index];
//item.$.personNumber.setContent((index) + ". ");
item.$.personName.setContent(person);
//item.$.personName.applyStyle("color", person.sex == "male" ? "dodgerblue" : "deeppink");
},
});