Getting error Object [object Object] has no method 'multiselect' when using library for Chromium Embedded Framework 3
prasad0310 opened this issue · 1 comments
prasad0310 commented
Hello,
I have integrated this library for making dropdowns multselect. my code is as below :
<script src="../lib/jquery-1.9.1.js"></script>
<script src="../lib/jquery.multiselect.js"></script>
<link href="../lib/jquery.multiselect.css" rel="stylesheet" />
<div class="selectBoxDiv">
<select id="constraintOptionsID" name="constraintOptions[]" class="dropDownClsText" multiple="multiple">
<option value="SearchCaption">Search Caption</option>
<option value="SearchCredit">Search Credit</option>
<option value="SearchKeywords">Search Keywords</option>
<option value="SearchMediaTitle">Search Media Title</option>
</select>
</div>
<button class="button searchBtn" style="float: left; margin-left: 15px; margin-top: 5px;" onclick="reset()">Clear</button>
<script>
$('#constraintOptionsID[multiple]').multiselect({
columns: 1,
placeholder: 'Constraint Options',
selectAll : true
});
function reset(){
$('#constraintOptionsID[multiple]').multiselect('reset');
}
</script>
This code for displaying multiselect worked fine it creates multiselect dropdown but when i use reset api for clear all the selected options then it shows
Object [object Object] has no method 'multiselect'
the code for reset api is as follows :
$('#constraintOptionsID[multiple]').multiselect('reset');
I wonder why it is not getting multiselect method in reset api.
any help is highly appreciated !!
nobleclem commented
What if you were to try something like:
<script>
var mySelect = $('#constraintOptionsID[multiple]');
mySelect.multiselect({
columns: 1,
placeholder: 'Constraint Options',
selectAll : true
});
function reset(){
mySelect.multiselect('reset');
}
</script>
I have no experience with Chromium Embedded Framework. So I am not sure I would be of any help there.