Problems obtaining duplicate data records

Problems obtaining duplicate data records

mariale83mariale83 Posts: 2Questions: 1Answers: 0
edited August 2015 in Free community support

I need to get the data in the table with help of two methods where obtendo records in the table (amount) but the values obtained are duplicates some records. I appreciate your support.

//------add records table--------
 // p_array_contenido = ["11111111", "NOMBRE", "APELLIDO", "-- --", "<input type="text" id="1_1">", "<input type="text" id="1_2" maxlength="10">"]
    $(p_table).dataTable().fnAddData( [
        p_array_contenido 
      ] );
//-----methods 1 - get data--------
var vj_tabla_objeto = $(vj_tabla_datos).DataTable();  //Se obtiene los datos de la tabla
var vj_data = vj_tabla_objeto.rows().data();
for(i = 0; i< vj_data.length; i++){
     vj_ci = vj_data[i][0];
}
//-----methods 2 - get data--------
var vj_tabla_objeto = $(vj_tabla_datos).dataTable();  //Se obtiene los datos de la tabla
var vj_data = vj_tabla_objeto.fnGetData();
for(i = 0; i< vj_data.length; i++){
     vj_ci = vj_data[i][0];
}

Answers

  • mariale83mariale83 Posts: 2Questions: 1Answers: 0
    edited August 2015

    I solved it by adding data:

    var v_tabla = $(p_table).DataTable();          
        
        v_tabla.row.add( [
          p_array_contenido[0],
          p_array_contenido[1],
          p_array_contenido[2],
          p_array_contenido[3],
          p_array_contenido[4],
          p_array_contenido[5],
          ]
         ).draw();
    
This discussion has been closed.