ikSelect
ikSelect copied to clipboard
Sync with original select's changes
Hello, thanks for nice plugin.
Problem: fake and original selects don't synchronize properly when original changed programmatically.
Case: change original select programmatically (E.g.: selectElement.selectedIndex = 2).
In this case ikSelect doesn't update itself. And there is no method to do this manually, something like "sync" or "refresh".
I've found a workaround, but it's haky a little bit:
$('select.mySelect').ikSelect('showDropdown').ikSelect('hideDropdown');
So it's looks like there is two options:
- make an auto synchronization (didn't investigate yet), or
- add a public method to synchronize fake and original selects.
My previous workaround with showDropdown and hideDropdown is bad: native select could stay open on iPad2. Also it leaves focus on last select. Better way to use select method:
$('select').each(function() { $(this).ikSelect('select', this.value) });