Comments (3)
There is a bug in SelectBoxIt that is preventing you from "refreshing" more than one dropdown with the same class name. I will fix it tonight. In the mean time, here is a workaround.
Note This is the actual solution, not a workaround.
from jquery.selectboxit.js.
Awesome. Thank you for a quick response.
from jquery.selectboxit.js.
So after further review, this is not a SelectBoxIt bug. It is instead a pattern of the jQueryUI Widget Factory.
Since the jQueryUI Widget Factory automatically stores the SelectBoxIt object (which contains all SelectBoxIt methods) inside of the jQuery data object of each DOM element, you can loop through all SelectBoxIt elements and call the refresh method on each one.
Below is sample code that will update the default option text of all select boxes with a class of test, and then "refresh" each SelectBoxIt dropdown after two seconds:
// Calls the plugin on all select box elements with a test class
$("select.test").selectBoxIt();
// Sets a timeout of two seconds
setTimeout(function() {
// Loops through all of the select box elements using SelectBoxIt
$(":selectBox-selectBoxIt").each(function() {
// Changes the text of each select box option
$(this).find('option').first().text('Updated text');
// Calls the refresh method on each select box element
$(this).data("selectBoxIt").refresh();
});
}, 2000);
from jquery.selectboxit.js.
Related Issues (20)
- copyAttributes and read all their values e one more thing
- Sass and css in same folder - gulp error
- data-selectedtext doesn't work on mobile HOT 3
- Can't open SelectBoxIt in VoiceOver/Safari
- Safari autofill does not work with select fields HOT 1
- How to remove `aria-labelledby` attribute? HOT 1
- Deprecated method in jQuery 3.3.*
- Calling selectOption result in Uncaught RangeError: Maximum call stack size exceeded
- hideCurrent option doesn't work HOT 2
- Replace specific option with new option
- ajust max-width calculation
- Selectbox underneath another element can be clicked
- SelectBoxIt doesnt work with class selector.
- aria role combobox is not valid
- npm & webpack
- Cannot select options on safari 13.2
- SelectBoxIt attribute issues HOT 1
- Inaccessible by keyboard
- Does not allow Mouse Scroll(Mouse Wheel) ? HOT 1
- The remaining code is not executed if dropdown doesn't contain that value
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from jquery.selectboxit.js.