2个arraylist的问题

时间:2017-11-07 17:03:45

标签: javascript

我目前有以下代码:

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;
}

我想要做的是,2个数组变为1.我解释它。enter image description here

我目前有以下代码,我想要做的是,2个数组变为1,我解释一下。 在第二个和第三个中都显示了相同的array1,你想要做的是将它放在一个列中,这个列或多或少地说明了第一个列,表示列如下:Id = 2, Nombre = Celestial Test,Peso = 85。

我很感激帮助。

这就是我现在得到的答案

enter image description here

0 个答案:

没有答案