Update specific column of rows in existing datatables

Update specific column of rows in existing datatables

puremindquietheartpuremindquietheart Posts: 4Questions: 1Answers: 0
edited November 2018 in Free community support

I am stuck in here for a few days now and I want to finish this final module of mine.

My expected result is like this one:

ordered qty | stocked quantity|
_________ | _____________|
3 | 5 |
1 | 2 |
1 | 1 |

But currently working code is like this

ordered qty | stocked quantity|
_________ | _____________|
3 | 3 |
1 | 1 |
1 | 1 |
| 5 |
| 2 |
| 1 |

My working code is like this.
for(var i=0; i < count; i++) { table.row.add(["", "", "", stocked_qty_array[i], "", "", "", "", "", ""]); } table.draw();

I am completely aware that it works fine but it's not the result that I am expecting. Can someone please give me some idea about this? Thank you guys!!

This is my screenshot:

Answers

  • puremindquietheartpuremindquietheart Posts: 4Questions: 1Answers: 0
    edited November 2018

    This is my sample screenshot of the matter.

  • puremindquietheartpuremindquietheart Posts: 4Questions: 1Answers: 0

    SOLVED:

    I already solved my own issue by using .rows() with .each function and also using for loop for providing array values on each rows' column.

    Like this code:

    table.rows().each(function(){ for(var i=0; i < count; i++){ table.cell({ row: i, column: 3 }).data(empty[i]).draw(); } });

  • puremindquietheartpuremindquietheart Posts: 4Questions: 1Answers: 0

    work like as I expected

This discussion has been closed.