0

In AngularJS I have an unknown number of NumericTextBoxes (they are made in an ng-repeat):

<input kendo-numeric-text-box
   k-format="'c2'"
   class="form-control"
   k-min="0" k-max="10000000"
   k-ng-model="fund.Amount"/>

When a user clicks any text box, if the value is $0 then the field should clear. My users are complaining that they have to manually remove the 0 each time they tap a Kendo NumericTextBox.

I tried this but it fails:

$(function() {
  $('[data-role="numerictextbox"]').each(function(){
    var textbox = $(this);
    textbox.value(null);
  }); 
});
Ian Vink
  • 66,960
  • 104
  • 341
  • 555
  • have you tried to write directive? (jQuery things like this wont work in general, and your concrete does smth very strange) – Petr Averyanov Jun 18 '18 at 15:03

1 Answers1

0

I found a simple work around for my purposes. Set the model that the Kendo Control is bound to equal to null. That way the Kendo control shows a blank, not $0

Ian Vink
  • 66,960
  • 104
  • 341
  • 555