mirror of
https://git.imnavajas.es/jjimenez/safekat.git
synced 2025-07-25 22:52:08 +00:00
arreglado los select2 para que funcionen con el select2 de alvaro
This commit is contained in:
@ -4,9 +4,11 @@
|
||||
* @param {String} url
|
||||
* @param {String} placeholder
|
||||
*/
|
||||
let ClassSelect = function (domItem, url, placeholder, allowClear = false) {
|
||||
let ClassSelect = function (domItem, url, placeholder, allowClear = false, params = {}) {
|
||||
this.url = url;
|
||||
this.item = domItem;
|
||||
this.params = params;
|
||||
|
||||
this.config = {
|
||||
placeholder: placeholder,
|
||||
allowClear: allowClear,
|
||||
@ -15,10 +17,14 @@ let ClassSelect = function (domItem, url, placeholder, allowClear = false) {
|
||||
url: () => {
|
||||
return this.url;
|
||||
},
|
||||
data: function (params) {
|
||||
return {
|
||||
q: $.trim(params.term),
|
||||
};
|
||||
data: (params) => {
|
||||
let d = $.trim(params.term);
|
||||
|
||||
for (let key in this.params) {
|
||||
d[key] = this.params[key];
|
||||
}
|
||||
|
||||
return d;
|
||||
},
|
||||
processResults: function (data) {
|
||||
return {
|
||||
|
||||
@ -10,7 +10,7 @@ class DatosGenerales {
|
||||
this.validatorStepper = validatorStepper;
|
||||
|
||||
this.formatoLibro = new ClassSelect($("#papelFormatoId"), '/papel-formato/menuitems', window.translations["formatoLibro"]);
|
||||
this.cliente = new ClassSelect($("#clienteId"), '/clientes/cliente/menuitems', window.translations["selectCliente"]);
|
||||
this.cliente = new ClassSelect($("#clienteId"), '/clientes/cliente/getSelect2', window.translations["selectCliente"]);
|
||||
|
||||
this.titulo = this.domItem.find("#titulo");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user