Closed geekasso closed 1 year ago
Not sure if this is the cleanest way to get it done, but considering the documentation is quite hazy I ended up with this - which seems to work for my use case. I also have multiple drop downs on the page and this handles the data for the drop down where the values were cleared.
$('.dropdown.icon.clear').on('click', function (e) { e.preventDefault(); let value = $(this).prev().val(); if (value) { // do something } return; });
I have a searchable, clearable, single select drop-down, which makes an ajax call during onChange event.
When a user clears the selection using the clearable button, I need to get the values that were there without a separate button, preferably via the onChange event, so that the ajax function can run based on what occured.
Based on the documentation, it seems it may only be possible with a multi select drop down, not a single select. Is that the case? How could I implement this for a single select drop-down?