function ViewModel() { var self = this; self.data = get2Darray(); self.currentItem = {???}; self.itemDetails = ko.computed(function () { return self.currentItem.blah +self.currentItem.blah2; }); self.getNext = ko.computed(function () { self.currentItem = self.data(--{Next}--);;//??? }); }; ko.applyBindings(new ViewModel());
<div class='mazeRow' data-bind="foreach: data" > <div data-bind="attr: { 'class': fuzzy }"></div> </div> <input type="button" id="Button3" data-bind="click: btn_Click, enabled: currentItem.enabled" value="FraggelRock"/> <input type="button" id="Button4" data-bind="click: getNext" value="move Next"/>
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)