kendo组合框在从控制器加载视图后重置 [英] kendo combobox reset after loading back view from controller
本文介绍了kendo组合框在从控制器加载视图后重置的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一个kendo组合框
I have a kendo combobox
@(Html.Kendo().ComboBox()
.Name("ddSystems")
.Filter("contains")
.Placeholder("-- Select --")
.BindTo((IEnumerable<SelectListItem>)ViewBag.systemList)
)
Onchange,ajax中加载了一个文本框。提交按钮将textbox值和组合框值发布到控制器。当我回到视图,我需要ddSystems重置为空。我使用
Onchange, a textbox is loaded in ajax. A submit button posts the textbox value and combobox value to the controller. When I get back to the view, I need ddSystems to be reset to empty. I used
$('#ddSystems').data('kendoComboBox').value(null)
和
$('#ddSystems').data('kendoComboBox').text('')
始终保留先前选择的值。因为我使用ajax,这将不显示文本框,我被卡住了。请帮助。
but it always retains the previously selected value. Since I use ajax, this will not display the textbox and I am stuck. Please help.
推荐答案
这将清除组合框并禁用它
This will clear the combo box and disable it
Google是您最好的朋友....
Google is your best friend....
var combobox = $("#comboBox").data("kendoComboBox");
combobox.value();
combobox.enable(false);
这篇关于kendo组合框在从控制器加载视图后重置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文