select2
.select2-selection__rendered {
line-height: 31px !important;
}
.select2-container .select2-selection--single {
height: 35px !important;
}
.select2-selection__arrow {
height: 34px !important;
}$('.js-example-basic-single').select2({
placeholder: 'Select an option'
});$(".js-example-basic-multiple-limit").select2({
maximumSelectionLength: 3
});$('#element').select2({
placeholder: 'Select a option',
minimumInputLength: 3,
ajax: {
url: route('api.fetch-options'),
dataType: 'json',
type: 'GET',
quietMillis: 50,
data: function (params) {
return {
visitor_name: params.term
}
},
processResults({ data }) {
return {
results: $.map(data, function (item) {
return {
text: item.name,
id: item.id,
}
})
}
}
}
}).change(() => {
// perform some action on change
});
Also in JavaScript:
- datatables sorting order
- add 10px to width js
- js class
- async iife
- vue js access heroku port
- jquery check if a class exists
- js get the week monday to friday date
- javascript all type of data
- javascript title string
- react repeat
- jquery attr
- how to check leap year in javascript
- check if a variable is array in javascript
- angular access service in console
- js copy array
- toggle class onscroll hook react
- javascript is not null
- javascript replace
- how to manage logging using winston for production and development in node js "github"
- how to push object in array using for loop javascript
- get value in tag with id JS
- upload photos cypress
- graphql playground bad request on heroku
- javascript sort numbers descending