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

.refresh() does not update data-subtext values #293

Closed
altearius opened this issue Sep 5, 2013 · 3 comments
Closed

.refresh() does not update data-subtext values #293

altearius opened this issue Sep 5, 2013 · 3 comments

Comments

@altearius
Copy link
Contributor

Calling $(...).selectpicker("refresh") will add new data-subtext values but not update existing values or remove values.

I have created a simple example in jsFiddle to demonstrate this behavior: http://jsfiddle.net/ChrisNielsen/pvT8Q/

The example shows that, currently, creating a new data-subtext attribute on the underlying select element and calling refresh will cause the new sub-text value to be displayed. However, changing or removing an existing data-subtext attribute will not cause the sub-text value to update appropriately.

@caseyjhol
Copy link
Member

To update it, you need to use .data("subtext", "new value") instead of .attr().

See it in action here: http://jsfiddle.net/caseyjhol/pvT8Q/1/

@zba
Copy link

zba commented Dec 5, 2013

Please reopen, refresh not creates subtext when data-show-subtext is true

see create subtext here

also the data-show-subtext requere to be set as attribute and not works if set via data();

@siboulet
Copy link

I'm also having issue dynamically updating subtext. The jsfiddle above no longer seems to work.

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

4 participants