diff --git a/src/jquery.bootstrap-duallistbox.js b/src/jquery.bootstrap-duallistbox.js index d94d4ae..d5c97dc 100644 --- a/src/jquery.bootstrap-duallistbox.js +++ b/src/jquery.bootstrap-duallistbox.js @@ -746,6 +746,19 @@ this.element.show(); $.data(this, 'plugin_' + pluginName, null); return this.element; + }, + populateAndSort: function (some_sortIndex) { + refreshSelects(this); + + if (this.settings.sortByInputOrder) { + sortOptionsByInputOrder(this.elements.select2); + } else { + sortOptions(this.elements.select2); + } + + if (some_sortIndex != null) { + this.sortIndex = some_sortIndex; + } } };