This question is a continuation of this..
I have an observable array as follows:
var myObservableArray = ko.observableArray([
{ name: "Bungle", type: "Unknown" },
{ name: "George", type: "Unknown" },
{ name: "Zippy", type: "Unknown" }
]);
I fill up a select list box using the below code:
<select data-bind="options: myObservableArray,
optionsText: function(item) {
return item.name + '-' + item.type;
},optionsValue:'name',
value: selected"></select>
I need a method which can change the type of selected value to 'mytype'
eg.. if Bungle is selected... { name: "Bungle", type: "mytype" }
Any help is sincerely appreciated.