function ProductViewModel()
{
var self = this;
self.Amount= ko.observable(0);
self.Quantity= ko.observable(0);
}
ko.extenders.numeric = function(target, precision) {
var result = ko.computed({
read: target,
write: function(newValue) {
var value = parseFloat(newValue,10);
if(precision > 0){
target(value.toFixed(precision));
}
else{
target(Math.round(value));
}
}
});
result(target());
return result;
};
ko.applyBindings(new ProductViewModel());
Now i want to add extenders dynamically after observable is created not at a time of declaration ? I also fetching data from server and converting to observable using ko.mapping.fromJS(data) and after that i want to add extenders...so guide me guys....