Problem with fnAddData and hidden column

Problem with fnAddData and hidden column

YuriiYurii Posts: 16Questions: 0Answers: 0
edited June 2012 in DataTables 1.9
I have a table with 10 column, and 2 of it are hidden. When I try to add a new row with fnAddData() it adds the new row, starting from the first shown column. Here is the code I'm using

[code]
oTable.fnAddData( [
"1.1",
"1.2",
"1.3",
"1.4",
"1.5",
"1.6",
"1.7",
"1.8",
"1.9",
"1.10" ]
);
[/code]

1.1 and 1.2 show be hidden, but when the function is executed, 1.9 and 1.10 goes into NEW columns at end of the table... What can I do?

Replies

  • koosvdkolkkoosvdkolk Posts: 169Questions: 0Answers: 0
    Weird, could you provide a live example at http://live.datatables.net/#javascript,html,live?
  • YuriiYurii Posts: 16Questions: 0Answers: 0
    edited June 2012
    It's the first time I use this, can you see the code?

    http://live.datatables.net/umuliv/4/edit

    and the working example?

    http://live.datatables.net/umuliv/4
  • YuriiYurii Posts: 16Questions: 0Answers: 0
    I sorted it out adding classnames to each cell, after adding them... Is that the best solution?
  • koosvdkolkkoosvdkolk Posts: 169Questions: 0Answers: 0
    I think you should let DT hide the columns: http://datatables.net/examples/basic_init/hidden_columns.html
  • jigarshahjigarshah Posts: 5Questions: 0Answers: 0
    @koosvdkolk bVisible:false hides column while initialising. So when e do fnAddData ..that extra data is not added.

    http://live.datatables.net/ijotap/10/edit#javascript,html
This discussion has been closed.