Comments (3)
Would be interesting for what you will need this, but you can do something like:
$('theSelectId').show().getNext('chzn-container').destroy();
This will show the hidden form field again and destroy the chosen container and the bound events(!), maybe not a perfect solution but a useable.
from chosen.
Hi,
I've done that, to update the chosen on window resize (responsive design with % width) with jQuery:
$('select').chosen(); $(window).resize(function(){ $('select').unbind().each(function(){ $(this).show().removeAttr("id").removeAttr("class"); if($(this).next('.chzn-container').length>0){ $(this).next('.chzn-container').remove(); } $(this).chosen(); }); });
from chosen.
Sandrine, thnx for this, good idea for responsive design. But for update/resize reasons I would suggest a faster solution instead of rebuilding choosen again, especially if there are alot of chosen elements or alot of entries in the dropdowns.
I looked at the code and there are three width values which have to be recalculated on update: 'this.f_width' for the container, 'dd_width' for the dropdown and 'sf_width' for the search field. All can be found in 'set_up_html()', put these things in an update() function and it should be done.
from chosen.
Related Issues (20)
- There doesn't seem to be support for a title tag inside the option.
- Great Plugin
- No results when I type spaces HOT 2
- Bug when selecting item - deselect it and select it again
- Chosen Script ignores disabled attribute
- Bug searching for items (both starts with and contains)
- Chosen updated to 1.0
- List of options?
- Bug : css inheritance
- Disco Link is broken HOT 1
- Chosen multiple select w/groups not showing up on Heroku app
- Searching from beginning vs middle
- How to clear selected values in multiple chzn-select
- Backwards compatibility
- Get original option "value": how "Chosen" work ? HOT 3
- Chosen with Laravel
- Outdated event description at http://julesjanssen.github.io/chosen/
- Special character on search
- search issue HOT 5
- Screen Reader Issue
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 chosen.