Change function DropDownListFor

Hello,

How the Change Function works in DropdownlistFor in this example:

                                @Html.EJS().DropDownListFor(c => c.Tecnico_id).Change("changetecnico").ShowClearButton(true).AllowFiltering(true).Width("98%").Placeholder("Selecione").DataSource((IEnumerable<Object>)ViewBag.tecnico).Fields(new Syncfusion.EJ2.DropDowns.DropDownListFieldSettings { Text = "Nome_fantasia", Value = "Favorecido_id" }).Render()

<script>

function changetecnico() {

 var dropproduto = document.getElementById('Tecnico_id').ej2_instances[0];

var valueid = dropproduto.value(); // I need get the value

...

}

</script>


Thanks



1 Reply

SP Sureshkumar P Syncfusion Team January 18, 2023 01:42 PM UTC

Hi Fernando,

You can get the component changed value inside the change event using argument value.

Find the screenshot here:


Regards,

Sureshkumar P


Loader.
Up arrow icon