enyo.kind({
name: "App",
kind: "enyo.Application",
view: "TestView"
});
enyo.kind({
name: 'TestView',
selectedCountTotal: 0,
components: [
{kind: 'onyx.Button', content: 'Disable Select', ontap: 'goDisable'},
{name: 'repeater', kind: 'enyo.DataRepeater', ontap: 'itemSelected',
components: [
{
components: [{name: 'display'} ],
bindings: [{from: '.model.display', to: '.$.display.content'}]
}
]},
{name: 'selectedItem', content: 'Currently Selected : '},
{name: 'selectedCount'}
],
bindings: [
{from: '.collection', to: '.$.repeater.collection'}
],
create: function () {
this.inherited(arguments);
this.collection = new enyo.Collection();
this.collection.add(this.data);
},
itemSelected: function (inSender, inEvent) {
// item obviously only changes if repeater.selection is true:
var item = this.$.repeater.selected().get('display');
this.selectedCountTotal++; // This continues to climb after select is disabled.
this.$.selectedCount.setContent(this.selectedCountTotal);
this.$.selectedItem.setContent('Currently Selected : ' + item);
},
goDisable: function (inSender, inEvent) {
this.$.repeater.selection = false;
},
data: [
{display: 'Alpha'},
{display: 'Beta'},
{display: 'Gamma'},
]
});
new App().renderInto(document.body);
Thanks for any help! It looks like you're new here. If you want to get involved, click one of these buttons!
Comments