// Instance created on multiselect component
var multiselectObj = document.getElementById('ddlFilterEmployee').ej2_instances[0];
// Get the selected value through Value property
console.log(multiselectObj.value); |
function OnSelect(args) {
var multiselectObj = document.getElementById('ddlFilterEmployee').ej2_instances[0];
console.log(args.itemData[multiselectObj.fields.value]);
} |
@using Syncfusion.EJ2;
@using Syncfusion.EJ2.Inputs;
@Html.EJS().MultiSelect("ddlFilterEmployee").Change("OnChange").ChangeOnBlur(false).Placeholder("Select a Country").PopupHeight("200px").DataSource(dataManger =>
dataManger.Url("/Home/UrlDatasource").Adaptor("UrlAdaptor").CrossDomain(true)).Fields(new Syncfusion.EJ2.DropDowns.MultiSelectFieldSettings
{
Value = "shipCountry", Text="shipCountry"
}).Render()
<script>
function OnChange() {
var multiselectObj = document.getElementById('ddlFilterEmployee').ej2_instances[0];
console.log(multiselectObj.value);
}
</script> |