Dear KendoUI Team!
I hope you can help me out. I want to update some Editor Templates from the old Telerik Controls. I am using ASP.Net MVC 4.
My Editor Template looks like this
What I want to do is to set the value of the Textbox in the Change Event of the Combo-Box. My Approach is using .val()
$(elementName).val(e.sender.dataItem().Value);
The value displayed in the Textbox is changed then. BUT: The value transfered to the server is the old value of the Textbox.
Example:
The field has the value "US". I edit the row. I change the value to "CN" using the Combobox. "CN" is now displayed in the textbox in edit mode. When I want to update the row, "US" is provided as the value for the field in the model.
Is there a way to make kendoUI transfer the values that are displayed?
brgds
Malcolm Howlett
I hope you can help me out. I want to update some Editor Templates from the old Telerik Controls. I am using ASP.Net MVC 4.
My Editor Template looks like this
@model string
@using System.Collections
<
div
style
=
"white-space:nowrap;"
>
@Html.TextBoxFor(m => m, new { onclick = "setInvisible(\"SplitCountryList#=Rid#\")", onfocus = "setInvisible(\"SplitCountryList#=Rid#\")", id = "CoPrefSplit#=Rid#" })
<
button
id
=
"SplitCountryDisplay"
onclick
=
"setVisibleAndFocus('\\#SplitCountryList#=Rid#','\\#SplitCountryCombo-input')"
style
=
"background-color:White; width: 20px; height:22px; font-size: 6pt"
>...</
button
>
</
div
>
<
div
id
=
"SplitCountryList#=Rid#"
style
=
"position: absolute; overflow:visible; width:250px; z-index:99; margin-top: 0px; visibility:hidden;"
>
@(Html.Kendo().ComboBoxFor(m => m)
.Name("SplitCountryCombo#=Rid#")
.BindTo(new SelectList((IEnumerable)ViewData["Countries"], "Code", "DisplayName"))
.HtmlAttributes(new {@ArticleID = "#=Rid#"})
.Filter(FilterType.Contains)
.Events(events => events
.Change("onSplitCountryChanged")
)
)
</
div
>
What I want to do is to set the value of the Textbox in the Change Event of the Combo-Box. My Approach is using .val()
$(elementName).val(e.sender.dataItem().Value);
The value displayed in the Textbox is changed then. BUT: The value transfered to the server is the old value of the Textbox.
Example:
The field has the value "US". I edit the row. I change the value to "CN" using the Combobox. "CN" is now displayed in the textbox in edit mode. When I want to update the row, "US" is provided as the value for the field in the model.
Is there a way to make kendoUI transfer the values that are displayed?
brgds
Malcolm Howlett