diff options
author | lou <louiscuny@gmail.com> | 2011-09-14 18:32:11 +0200 |
---|---|---|
committer | lou <louiscuny@gmail.com> | 2011-09-14 18:32:11 +0200 |
commit | aa4b5d6ac1e611dfcf40531ceeede7cd9a87e5cf (patch) | |
tree | bf2d73e3aa11369e27cf108fbb063a3085529ae8 /js | |
parent | 4c672bdb15cc1e6b6071f6dbbbf5a3e784f49f74 (diff) | |
parent | 3de04f0964882ff04ae51a08c01a7c582e874a6a (diff) | |
download | multi-select-aa4b5d6ac1e611dfcf40531ceeede7cd9a87e5cf.zip multi-select-aa4b5d6ac1e611dfcf40531ceeede7cd9a87e5cf.tar.gz multi-select-aa4b5d6ac1e611dfcf40531ceeede7cd9a87e5cf.tar.bz2 |
Merge branch 'master' of github.com:lou/multi-select
Diffstat (limited to 'js')
-rw-r--r-- | js/jquery.multi-select.js | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/js/jquery.multi-select.js b/js/jquery.multi-select.js index 98f0770..c5c9497 100644 --- a/js/jquery.multi-select.js +++ b/js/jquery.multi-select.js @@ -73,13 +73,17 @@ } }); }, + 'refresh' : function() { + $("#ms-"+$(this).attr("id")).remove(); + $(this).multiSelect("init"); + }, 'select' : function(value, method){ var ms = this, selectedOption = ms.find('option[value="'+value +'"]'), text = selectedOption.text(), titleAttr = selectedOption.attr('title'); - var selectedLi = $('<li class="ms-elem-selected" ms-value="'+value+'">'+text+'</li>').detach(), + var selectedLi = $('<li class="ms-elem-selected" ms-value="'+value+'">'+text+'</li>'), selectableUl = $('#ms-'+ms.attr('id')+' .ms-selectable ul'), selectedUl = $('#ms-'+ms.attr('id')+' .ms-selection ul'), selectableLi = selectableUl.children('li[ms-value="'+value+'"]'), |