I can not find how to customize my select2
as they do in the API. ( here the link ).
I search everywhere and in the same Pligin API they do not specify anything of how to do it. I clarify that I do it in my system but in a simple way.
Here's the code:
$('#crear_lineas_de_produccion').select2({
placeholder: "Nombre",
allowClear: true,
ajax: {
type: "GET",
dataType: 'json',
url: 'procesos/select/getLineasdeProduccion',
delay: 250,
data: function(params) {
return {
term: params.term, // search term
page: params.page || 1, //page number
}
},
processResults: function (data, page) {
return {
results: data.results,
pagination: {
more: data.pagination.more,
}
};
},
cache: true
}
});
Update 1: The result that throws me is the following:
I would like something like in the documentation:
I want to do something like this to place the descriptions of the lots that are better ordered and not separated by a "/", it's the only thing that occurred to me.