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

A way to update option item dynamically at runtime #18

Closed
July-G opened this issue Oct 3, 2012 · 2 comments
Closed

A way to update option item dynamically at runtime #18

July-G opened this issue Oct 3, 2012 · 2 comments

Comments

@July-G
Copy link

July-G commented Oct 3, 2012

HI, i'm using chosenlistbox widget, my app needs to update chosen option items dynamically at runtime, my way is to clear all the old option items and add new ones to them, like below:

chosen.clear();
chosen.addItem("myitem");

However it still keep the old options and did not update at all. I'd like to know the correctly ways to achieve this behavior.

Thanks.

@jDramaix
Copy link
Contributor

jDramaix commented Oct 3, 2012

As mentionned in the doc, you have to call the update method when you modify the content of the component

chosen.clear();
chosen.addItem("myitem1");
chosen.addItem("myitem2");
chosen.addItem("myitem3");
...
chosen.update();

@jDramaix jDramaix closed this as completed Oct 3, 2012
@July-G
Copy link
Author

July-G commented Oct 3, 2012

It works, sorry i just miss the doc.

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