here is what i set for ComboBoxFor
.Name(
"CustomerBranchId")
.DataBinding(binding => binding.Ajax().Select(
"_GetBranchId", "CustomerProfile"))
.AutoFill(
true)
.HtmlAttributes(
new {style = "width: 80px;top: 7px"})
.HighlightFirstMatch(
true)
.ClientEvents(events => { events.OnLoad(
"comboOnLoad");
events.OnDataBinding(
"onBranchIdDataBinding");
events.OnOpen(
"onReloadCustomerBranchId");
events.OnChange(
"onCustomerBranchIdChange");})
.Render();%>
and here is javascript that i wrote
$(
"#CustomerId").change(function (e) {
CustomerBranchIdValue = $(
"#CustomerBranchId").data("tComboBox").value();
CustomerBrahchText = $(
"#CustomerBranchId").data("tComboBox").text();
$(
"#CustomerBranchId").data("tComboBox").reload();
$(
"#CustomerBranchId").data("tComboBox").value("");
$(
"#CustomerBranchId").data("tComboBox").text("");
});