I currently have the following code:
articulo.prototype.crearEspecificAsoc = function ($table) {
var lista = this.getColumnasEspec();
//this.View.initTablaEspecificacion($table, this.lstEspecificacionesView, lista);
this.View.initTablaEspecificacion($table, this.lstEspecificacionesAsociadas, lista);
console.log(lista, ' lista');
var lista2 = this.lstEspecificacionesAsociadas;
var lista3 = lista2.sort();
lista2[4] = lista.field;
console.log(this.lstEspecificacionesAsociadas, 'this.lstEspecificacionesAsociadas');
console.log(lista2, ' lista2');
return true;
};
articulo.prototype.getColumnasEspec = function () {
var arr = [];
var objColumns = {};
objColumns['field'] = 'IdNew';
objColumns['title'] = 'Id';
arr.push(objColumns);
_.forEach(this.lstEspecificaciones, function (item, index) {
objColumns = {};
objColumns['field'] = item.Nombre;//'Valor';//Valor[i]/*.Valor*/;
objColumns['title'] = item.Nombre;
arr.push(objColumns);
//objColumns = {};
//objColumns['field'] = 'Valor';//NuevasColumnasAsoc[i].Valor;
//objColumns['title'] = Espec_list.Nombre;
//arr.push(objColumns);
});
return arr;
}
What I want to do is, that 2 arrays become 1, I explain:
Both in the second and third, it shows the same array1, what you want to do is place it in a single column, which says more or less what the first says, that columns are made that say the following: Id = 2, Name = Celestial Test, Weight = 85. I appreciate the help.