I am using select2 with ajax option, and when ajax runs, a text "searching" appearing until ajax get success. I want to change this text(see in attached image
).
My code is:(reference from https://select2.org)
$("#employee_id").select2({
ajax: {
url: "get_store_data.php?type=employee_data",
dataType: 'json',
delay: 250,
data: function (params) {
return {
phrase: params.term, // search term,
store_name: jQuery("#store_name").val(),
page: 1
};
},
processResults: function (data, params) {
// console.log(data);
params.page = params.page || 1;
return {
results: data.map(function(item) {
return {
id: item.name,
text: item.name
};
}),
pagination: {
more: 0
}
};
},
placeholder: 'Search for a member id',
cache: true
},
escapeMarkup: function (markup) { return markup; },
minimumInputLength: 1
});