Hi,
I need to get the selected item's value rather than text in the combo box. But it always return the text. Please help me to solve this matter.
View@{
Html.EJ()
.ComboBox("LocList")
.AllowFiltering(true)
.ComboBoxFields(h => h.Text("Text").Value("Value"))
.Query("new ej.Query().select(['Text','Value']).take(50)")
.ClientSideEvents(h => h.Filtering("filtering")
.Change("change"))
.Datasource((IEnumerable<Object>)ViewBag.Locations)
.Placeholder("Select a Location")
.Render();
}
<script type="text/javascript">
function change(args) {
if ($('#LocList').val() != null) {
$.ajax({
url: '@ViewBag.RootFolder' + '/TransactionDateSetup/TransactionDateSetup',
type: "POST",
data: {
Loc_Key: $('#LocList').val() },
success: function (result) {
var obj2 = $("#FlatGrid").ejGrid("instance")
obj2.dataSource(result);
//var obj3 = $("#Grid").ejGrid("instance")
//obj3.dataSource(result);
},
error: function () {
}
});
}
}
</script>