Answer the question
In order to leave comments, you need to log in
Answer the question
In order to leave comments, you need to log in
here is my code
not working :
<select id="select-typepart" name="typepart" class="selectpicker form-control" data-max-options="3" data-live-search="true">
<option value="0">не выбрано</option>
<option value="1">выбрано1</option>
<option value="2">выбрано2</option>
</select>
<script src="http://code.jquery.com/jquery-3.2.1.min.js" integrity="sha256-hwg4gsxgFZhOsEEamdOYGBf13FyQuiTwlAQgxVSNgt4=" crossorigin="anonymous"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/js/bootstrap.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-select/1.7.5/js/bootstrap-select.min.js"></script>
$('select[name="typepart"]').select2({ // и по id пробовал выбирать и просто по селектору
language: {
noResults: function (params) {
return "Нет результатов ... или что-то ещё";
}
}
});
It all depends on the version of Select2.
In my case, when using version 3.5.3 , this parameter is set using formatNoMatches
:
$('#search-select').select2({
formatNoMatches: function () {
return "Нет результатов ... или что-то ещё";
}
});
noResults
, and possibly noMatches
. $('#search-select').select2({
"language": {
"noResults": function(){
return "Нет результатов ... или что-то ещё";
}
}
});
$('#search-select').select2({
"language": "ru"
});
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question