I'm wondering how to apply chosen
to multi-select drop-down in jtable
. I've tried adding chosen-select
as class
but its not working. I've tried ajaxComplete
also to check whether it might not be working because of ajax completion
but it didn't help.
Here's my code:
$(document).ajaxComplete(function () {
$(".chosen-select").chosen();
}); //post ajax
Also I've tried with data-rel="chosen"
to in jquery.jtable.js
, but it didn't help either. The multi-select list is coming but the problem is I have to show over 3500 locations in the list and it would become difficult to scroll and search locations, so that's why I want to use chosen
so that I can search in the text box which it suggests and one can easily select, and delete locations. I've tried posting images but reputation prevented me from doing that.
Finally got the solution. Need to do slight modification in jquery.jtable.js
Need to add two below lines before return statement inside _createDropDownListMultiForField
function
var $select_option = $('<script> $(".chosen-select").chosen(); $(document).ajaxComplete(function () { $(".chosen-select").chosen();});</script> ');
$containerDiv.append($select_option);
return $containerDiv;