Hi,
There is something I can’t solve.
I am loading the data from a JSON array into select2, and I would like to add some custom attributes, for example:
TextI am using this code:
$(id).select2({
language: "es",
$.map(respuesta, function (obj) {
console.log(obj);
return {
id: obj.id_cliente,
text: obj.nombre,
actividad: obj.actividad,
};
})
})
However, just add id and text.
Please, can you help me?
I know I can add the options with a foreach, but it is much slower when using DOM.
Thanks