Hi Kendo,
Is it possible to have custom bindings applied to template items?
i have this in a template:
<input style="width:22px;" type="text" data-bind="value: PercentOfValue" data-keyup="numericOnly" data-value-update="keyup" />
and this as a binding:
kendo.data.binders.numericOnly = kendo.data.Binder.extend({
refresh: function () {
$(this.element).bind('keyup', function (evt) {
var charCode = (evt.which) ? evt.which : event.keyCode;
if (charCode != 46 && charCode > 31
&& (charCode < 48 || charCode > 57)) {
return false;
}
return true;
});
}
});
This is the latest thing i've tried. I've also attempted to use the 'refresh' to simply rewrite the bound value to not include any letters etc without any success. It seems as though the refresh is simply ignored to those properties bound in a template. it is initially called when a new array item is added to the viewModel.. but never called when the value is "refreshed".
PLEASE respond to this.
Is it possible to have custom bindings applied to template items?
i have this in a template:
<input style="width:22px;" type="text" data-bind="value: PercentOfValue" data-keyup="numericOnly" data-value-update="keyup" />
and this as a binding:
kendo.data.binders.numericOnly = kendo.data.Binder.extend({
refresh: function () {
$(this.element).bind('keyup', function (evt) {
var charCode = (evt.which) ? evt.which : event.keyCode;
if (charCode != 46 && charCode > 31
&& (charCode < 48 || charCode > 57)) {
return false;
}
return true;
});
}
});
This is the latest thing i've tried. I've also attempted to use the 'refresh' to simply rewrite the bound value to not include any letters etc without any success. It seems as though the refresh is simply ignored to those properties bound in a template. it is initially called when a new array item is added to the viewModel.. but never called when the value is "refreshed".
PLEASE respond to this.