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

Ability to change the data without destroy/recreate a select2 input #2115

Closed
ggregoire opened this issue Feb 13, 2014 · 1 comment
Closed

Comments

@ggregoire
Copy link

Hi @ivaynberg!

Is it possible to change the data of a select2 input (not the selection but the whole data array)?

$input.select2({
    data: myData,
    width: '300px',
    placeholder: GLO_LANG_SELECT,
    // others properties
}).on('change', function (e) {
    add(e.val);
}).on('others events' ...

Then

$input.select2().data = myNewData;

It will be very helpful!

@kevin-brown
Copy link
Member

Merged into #2830 (comment).

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

2 participants