在 AngularJS 中,我有未知数量的 NumericTextBoxes(它们是在 ng-repeat 中制作的):
<input kendo-numeric-text-box
k-format="'c2'"
class="form-control"
k-min="0" k-max="10000000"
k-ng-model="fund.Amount"/>
当用户单击任何文本框时,如果值为 $0,则该字段应清除。我的用户抱怨每次点击 Kendo NumericTextBox 时都必须手动删除 0。
我试过这个但它失败了:
$(function() {
$('[data-role="numerictextbox"]').each(function(){
var textbox = $(this);
textbox.value(null);
});
});