How can I add new row column when column is hidden.

How can I add new row column when column is hidden.

AlanMezaAlanMeza Posts: 2Questions: 1Answers: 0
edited February 2018 in Free community support

I add a new row to datatable, but at the time I try to set data to one hidden row does not set any data. This appears like when row is hidden cannot do anything with it as row does not exists!
This is my table:

First column 2 3 4 5 6

-Dinamically i add new node:
var table = $('#descripcionPT').DataTable();
var rowNode = table.row.add( [
val 1,
val 3,
val 4,
val 5,
val 6,
val 7
] ).draw().node();

-And I have my columns datatable configuration:
columns: [
null,
null,
{ "width": "5%" },
null,
{ "visible": false },
{ "visible": false }
]
Could someone help me please?

Answers

  • AlanMezaAlanMeza Posts: 2Questions: 1Answers: 0
    edited February 2018
    I add a new row to datatable, but at the time I try to set data to one hidden row does not set any data. This appears like when row is hidden cannot do anything with it as row does not exists!
    This is my table:
     <table id="descripcionPT" class="cell-border highlight" cellspacing="0" width="100%">
            <thead>
              <tr>             
                  <th id="0">First column</th>
                  <th id="1">2</th>
                  <th id="2">3</th>
                  <th id="3">4</th>
                  <th id="4">5</th>
                  <th id="5">6</th>
              </tr>
            </thead>
            <tbody>           
            </tbody>
    </table>
    
    -Dinamically i add new node:
    var table = $('#descripcionPT').DataTable();
      var rowNode = table.row.add( [
                              val 1,
                              val 3,
                              val 4,                          
                              val 5,
                              val 6,
                              val 7
                          ] ).draw().node();
    
    -And I have my columns datatable configuration:
    columns: [                  
                        null,
                        null,
                        { "width": "5%" },
                        null,
                                        { "visible": false },
                                        { "visible": false }
               ] 
    Could someone help me please?
    
This discussion has been closed.