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

selectize.js rebind dropdown not working #805

Closed
sobaida opened this issue May 27, 2015 · 2 comments
Closed

selectize.js rebind dropdown not working #805

sobaida opened this issue May 27, 2015 · 2 comments

Comments

@sobaida
Copy link

sobaida commented May 27, 2015

I have a dropdown with id "selectCountry" filled by ajax and on success I just bind the Selectize.

$('#selectCountry').selectize({
create: true,
sortField: 'text'
});
When I rebind my original dropdown by ajax and try to reload/rebind or refreshed the old selectize auto complete box on success, there would be no change on old list.

Is there any way to reload or refresh selectize dropdown? I had try "clearOptions()" and "refreshOptions()".

P.S, I don't want to directly bind the selectize from ajax.

OK, now I am adding working example for this issue on https://jsfiddle.net/m06c56y0/16/

Please help me :( any suggestion would be great for me. Thanks alot

@PhiLhoSoft
Copy link
Contributor

You should not re-create the Selectize component out of the original tag. You should use it to update its options, using clearOptions() as you guessed.
I updated your fiddle (+1 for making one) to show this: https://jsfiddle.net/m06c56y0/20/

Note: IMHO, this kind of question doesn't really belong to issues of the project, more to Stackoverflow or similar...

@risadams
Copy link
Contributor

closing stale issues older than one year.
If this issue was closed in error please message the maintainers.
All issues must include a proper title, description, and examples.

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