如何刷新值剑道数字文本框? [英] How can I refresh value kendo numerictextbox?

查看:114
本文介绍了如何刷新值剑道数字文本框?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个kendoNumericTextBox.我有代码设置与kendoNumericTextBox关联的输入元素的值.例如,代码调用:

I have a kendoNumericTextBox. I have code that sets the value of the input element associated with the kendoNumericTextBox. For example, the code calls:

$('#myId').val('test');

不幸的是,剑道数字文本框不会自动反映该值.如何告诉kendoNumericTextBox更新其值?我知道kendoNumericTextBox上有一个方法,如下所示:

Unfortunately, the kendo numeric text box doesn't automatically reflect the value. How can I tell the kendoNumericTextBox to update its value? I know there's a method on kendoNumericTextBox as follows:

$('#myId').data('kendoNumericTextBox').value('test');

但是,我正在填充许多字段,但不确定到底是kendoNumericTextBox字段.因此,我更喜欢调用与所选插件类似的操作,以基于基础组件刷新值.例如,使用选定的插件,我可以调用:

However, I'm populating many fields and not exactly sure which ones will be kendoNumericTextBox fields. So, I prefer to call something like I do with the chosen plugin to refresh the value based on the underlying component. For example, with the chosen plugin, I can call:

$('.chosen').trigger('liszt:updated');

根据基础选择组件的值更新所有值.

to update all values based on the underlying select component's value.

推荐答案

var numerictextbox = $("#paymentAmount_" + id).data("kendoNumericTextBox");
    numerictextbox.value("0.00");

这对我有用.将元素存储在变量中,并使用双引号设置值.另外我也不能在numericTextBox中像'测试'这样的单词...我假设你的意思是作为测试数据.但这也应该对您有用.

This works for me. Store the element in a variable and the set the value using double quotes. Also I was not able to put a word in like 'test' in a numericTextBox...I am assuming you meant that as test data. But this should work for you as well.

这篇关于如何刷新值剑道数字文本框?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆