-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
There is no way to remove chosen from the page #133
Comments
I'm also unable to use Chosen for this reason. When I add new s to the page, calling .chosen() again breaks the selects that have already been .chosen() in the past. |
calling |
I have a form where the user can add more selects to the form on button click. I clone a div containing a select element each time the button is clicked, then do $('select').chosen(). All but the most recently added select lists then cease to work (clicking them no longer causes the list of options to open up). |
…hq#133. This addes a .unchosen() method to jQuery, and a Element.unchosen() to prototype. This is accomplished by storing the reference to the instantiated chosen item on the element, in jQuery using the data API, and on the DOM element for Prototype
I made pull request 147 to address this #147 |
… class style from css, as it doesn't make sense there, issue harvesthq#133
I add jquery unchosen method for this, it removes chosen combobox and get the original combobox back.
|
Your code doesn't replace the tab index nor remove the event listener from the input, which is done in my pull request |
Isn't that methode remove() will also remove bound events and jQuery data associated with the element? My apologize I'm not quite good here, it's just my quick and dirty solution. |
There is an event added to the original select box by jQuery / prototype |
+1 for this. DelvarWorld's .unchosen() fork works brilliantly but I can't upgrade to the latest version of chosen as I lose the ability to .unchosen() - and sadly there are bugs in the old version that I am having to fix myself rather than upgrade to the fixed new version! |
This is little plugin to remove chosen. $.fn.chosenDestroy = function () {
} For examle: $('select[name=countries]').chosenDestroy() |
@Capit0L Thanks! Don't see the need for .removeAttr('id') in the newest version. This works $.fn.chosenDestroy = function () {
$(this).show().removeClass('chzn-done')
$(this).next().remove()
return $(this);
}
|
Thank you.....cevarief |
Thanks! |
$input.chosen("destroy") #2290 |
There is no way currently to remove chosen from the page. I think there should be. Maybe $input.unchosen() or $Input.removeChosen(). Not all forms are static.
The text was updated successfully, but these errors were encountered: