You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
After debug, i fixed 1, 2 and 3 (other tests required). About 4th point, i noticed that the value of selected option, after search, is set correctly but placeholder "Nothing selected" isn't updated (works only if items loaded by "source.data").
Hi @adaniello, it seems to me the problem with 4. is the following.
In a 'non-ajax-search' scenario the selectpicker keeps track of two arrays:
selectpicker.main
selectpicker.current
main has all entries, current only the entries which match with the search-string. But, both lists point to the same objects. So if an item in the 'current' list gets selected, it is selected in the 'main' list also.
When using ajax-search, it looks like the 'main' list gets populated with items from 'load', and 'current' with items from 'search'. In the rendering process the control takes the 'main' list to determine which one should be selected. So a selection after a 'search' doesn't have any effect in this scenario.
I'm not a 100% sure this issue causes all the troubles; but I think when adding items to 'current', the key of this items should be looked up first in 'main'. New items could be added to 'main' also, existing items should use the same object in 'current' and 'main'?
Ajax/JSON support, "the highlight" of 1.14.0-beta release (https://github.com/snapappointments/bootstrap-select/releases/tag/v1.14.0-beta), seems not works.
My code is very simple (see at https://codepen.io/adaniello/pen/xxLVrKE) and returns some issues:
Is there someone who managed to make it work?
I already fixed 1 and 2 points (a pull-request will be available when all point fixed), but i'ld like to get some feedback on this issues.
Thanks
The text was updated successfully, but these errors were encountered: