Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Trigger search #172

Closed
LucaNitti opened this issue Jul 8, 2019 · 3 comments
Closed

Trigger search #172

LucaNitti opened this issue Jul 8, 2019 · 3 comments

Comments

@LucaNitti
Copy link

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
Copy link
Owner

@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
Copy link
Author

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
Copy link
Contributor

Aside from triggering the bindEvent as suggested above, no.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants