truckingsim / Ajax-Bootstrap-Select

This uses the bootstrap-select plugin and extends it so that you can use a remote source to search.
MIT License
280 stars 97 forks source link

Trigger search #172

Closed LucaNitti closed 4 years ago

LucaNitti commented 5 years ago

There is a way to trigger search? I need to programmatically trigger search event to reload some data without modify query. There i a way to do this?

truckingsim commented 5 years ago

@LucaNitti If you don't override the bindEvent option you can try:

$('#selectId').data('AjaxBootstrapSelect').$searchbox.trigger('keyup');

I haven't tried this as I don't have this running anywhere on my machine at the moment.

LucaNitti commented 5 years ago

yes, it works, but there is a way to trigger search and and mantain selection?

In my project the user can search a value or can choose from one or two default value. When user select a default value (using checkbox), i need to setup the correct value on select, make a query to my backend to retrieve some data.

markhalliwell commented 4 years ago

Aside from triggering the bindEvent as suggested above, no.