Hello, I am trying to use a simple multiselect drop down to act as a filter for a chart.
When I unselect the data from my dropdown, my chart refreshes properly. However I am noticing that when I select the values again, the selected values are not updating as I would expect. Here is my code for the component
<ejs-multiselect id="@Html.IdFor(m => m.SelectedValues)"
ejs-for="SelectedValues" dataSource="@Model.ValuesToSelect"
mode="CheckBox" showDropDownIcon="true"
removed="updateFilter" select="updateFilter" >
<e-multiselect-fields text="Text" value="Value"></e-multiselect-fields>
</ejs-multiselect>
and here is my function (for sake of this example I don't show the code that goes to my server to update the chart, just shows what values I selected from the component)
<script>
function updateFilter(){
var filterValues = document.getElementById("SelectedValues").ej2_instances[0].value;
console.log(filterValues)
}
</script>
the issue is that when I look at the log of filterValues, it does not match what I select in my drop downs, it "lags" by one button click;
Here is the list when I load it.
When I unselect all, as expected my console.log gives an empty [ ]
you can see the console logging the value getting smaller as each item is checked off until it is empty.
Now I try to go back and click the values in the drop down, say I click on publication
the value remains empty.
Now I click on another check box (Close Out)
Console.log only logs 1 value, and that value is for Publication, not for close out
If I keep going clicking one by one, I will eventually select all the items in the drop down but my filterValues will always have one item missing.
Is this a bug? Am I doing something incorrectly?
Please advise.
Jorge