-
Notifications
You must be signed in to change notification settings - Fork 301
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
Remove and Add #175
Comments
If I may, you can simply manipulate your underlaying SELECT element and refresh it. Like so
and repopulate it
The function |
@yanickrochon I did what you said, but the problem is the same as before ( when I used remove) It removes the options and the graphics and it doesn't add anything...:( If I use only the last part ( the append), it appends the new option ( like add, but add keeps the selectboxit graphic), but the graphics turns normal( not the selectboxit graphic) and I still have the same error as before. |
@reru Here is a jsbin that shows how you can remove all drop down options and populate a new drop down using the @yanickrochon Although confusing, SelectBoxIt has it's own |
It works!!! :) thank you very much! The problem was jquery...I looked at your example and I saw that you used jquery 1.8.3, on my page I had: 1.7.1 In your requirements you wrote: jQuery 1.7+, so I thought that it was ok, but it's not. You can check in your jsbin example( 1.7.1 doesn't work). I'm telling you this only to help, not to criticize such a fantastic job(your plugin)...maybe you should fix it for 1.7.1 or change the requirements. |
@reru Good catch! I will keep this issue open until the jQuery 1.7.1 issue is fixed. It should be fixed in the next release! |
I have decided to no longer fully support jQuery versions < 1.8.3 =) |
Hi, I am just trying using the add() methods with HTML strings which is same with the example HTML strings from populate options like below, however it still not able to read it! The reason to use HTML string is to display the label when populate the list. Example HTML strings from populate, Example HTML string will use to populate, '< optgroup label="Japan" >'+'< option value="tokyo" >Tokyo</ option >' + '</ optgroup >' + How to populate new drop down with HTML strings using add() method? |
Hi,
thank you for this great plugin. I have two select on my page and I would like to populate the second one when the user selects something from the first one. So, I need to remove all the old options and to add all the new options( I get them with ajax). I tried to use .remove() and then .add() and also .remove() and then populate, but it doesn't work. Is there a way to achieve what I want?
When I use .remove(), like in your example: $("select").data("selectBox-selectBoxIt").remove(); it removes the selectbox plugin on that select ( I have a select with no options and with the native select box graphics). Even if I remove only one option the graphics turn to normal ( no more selectboxit) and I have this errore: Cannot call method 'show' of undefined
Thank you again.
The text was updated successfully, but these errors were encountered: