-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Description
resources/assets/administrator/js/theme.js line 209
function with error handleLiveSearch()
Error: $(...).selectize is not a function
static handleLiveSearch() {
$('[data-type="livesearch"]').selectize({
valueField: 'id',
labelField: 'name',
searchField: ['name'],
create: false,
loadThrottle: 500,
maxOptions: 100,
load: function(query, callback) {
if (!query.length >= 3) return callback();
let selectize = $($(this)[0].$input);
let baseUrl = selectize.data('url');
let url = baseUrl + (-1 === baseUrl.indexOf('?') ? '?' : '&');
url += 'query=' + query;
$.ajax({
url: url,
type: 'GET',
error: callback,
success: function(res) {
if (!res.hasOwnProperty('items')) {
console.error(
'Livesearch response should have "items" collection. ' +
'Each element in collection must have at least 2 keys: "id" and "name"',
);
return false;
}
return callback(res.items);
},
});
},
});Metadata
Metadata
Assignees
Labels
No labels