multi select - How to use filter with "jQuery UI MultiSelect Widget" when populating the option using AJAX? -
i using "jquery ui multiselect widget" in application. 1 of nice futures in filter allow search option in drop down menu.
the problem having when populate option using ajax call filter option no longer work.
the ajax request correct , populates menu no issue when type in filter box in "multiselect" option not filter them..
here code
<script> $(function() { $("#lstbox2").multiselect().multiselectfilter({ filter: function(event, matches){ // find first matching checkbox var first_match = $( matches[0] ); } }); $('#client').change( function(){ $('#lstbox2').html(''); $.getjson("ajax/getcalltypes.php", { client_id: $(this).val() },function (data) { if ( ! data) return; $.each(data, function(i,v){ $('#lstbox2').append('<option value="'+ v.id +'">'+ v.name +'</option>'); }); } ).done(function(){ $("#lstbox2").multiselect('refresh'); }); }); }); </script>
Comments
Post a Comment