Skip to content

Loading…

new refresh function #108

Closed
wants to merge 1 commit into from

3 participants

@jrjohnson

Added a refresh function which just calls _populateLists internally

@NateEag

Just wanted to note that crdeutsch merged an equivalent patch into his fork, and has been staying on top of pull requests:

https://github.com/crdeutsch/multiselect/

@elavelle

I'm actually using Christopher Deutsch's fork, but I'm assuming that the code is the same. This works for me in FF, Opera, Chrome, and Safari, but not IE8 or IE9 - anyone seen this?

I'm filling in the select options via Ajax, and refreshing on Ajax 'done':
$('#myDiv').multiselect("refresh");

@elavelle

My fault - sorry. I'm setting the options in the select via innerHTML, and it turns out that there's an MSIE bug filed against this (http://support.microsoft.com/kb/276228/).

So, in short, you need to refresh to see the results of any dynamic updates to your multiselects, but you may also need to use one of the workarounds in the KB article to get anything to work in MSIE.

@jrjohnson

I'm closing this so it doesn't clutter up my list of active PRs

@jrjohnson jrjohnson closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Showing with 3 additions and 0 deletions.
  1. +3 −0 js/ui.multiselect.js
View
3 js/ui.multiselect.js
@@ -137,6 +137,9 @@ $.widget("ui.multiselect", {
$.Widget.prototype.destroy.apply(this, arguments);
},
+ refresh: function() {
+ this._populateLists(this.element.find('option'));
+ },
_populateLists: function(options) {
this.selectedList.children('.ui-element').remove();
this.availableList.children('.ui-element').remove();
Something went wrong with that request. Please try again.