Add possibility to remove search box from select2. #43
This commit is contained in:
10
script.js
10
script.js
@@ -356,9 +356,15 @@ $(function() {
|
|||||||
// Select2 related functions.
|
// Select2 related functions.
|
||||||
// ==========================
|
// ==========================
|
||||||
|
|
||||||
function initSelect2items() {
|
function initSelect2items(noSearch) {
|
||||||
|
var noSearch = typeof noSearch !== 'undefined' ? noSearch : false,
|
||||||
|
noSearchValue = 0;
|
||||||
|
if (noSearch) {
|
||||||
|
var noSearchValue = Infinity;
|
||||||
|
}
|
||||||
$('select').select2({
|
$('select').select2({
|
||||||
templateResult: formatState
|
templateResult: formatState,
|
||||||
|
minimumResultsForSearch: noSearchValue
|
||||||
});
|
});
|
||||||
|
|
||||||
$('select').on('select2:select', function(e) {
|
$('select').on('select2:select', function(e) {
|
||||||
|
|||||||
Reference in New Issue
Block a user