fnUpdate in DataTables for Dynamic Data

fnUpdate in DataTables for Dynamic Data

ronnjoeronnjoe Posts: 4Questions: 2Answers: 0

Hi,

Please help to verify why fnUpdate not working for dynamically generated dataTable. But instead it works fine for static dataTable.

Here is the fiddle for dynamically generated dataTable http://jsfiddle.net/ronnjoe/hMEFp/46/

Here is the fiddle for static dataTable http://jsfiddle.net/ronnjoe/hMEFp/48/

Thanks,
Joe

Answers

  • AshbjornAshbjorn Posts: 55Questions: 2Answers: 16

    Hi ronnjoe,

    When you are using dynamic (i.e. server-side) data you have to make adjustments to the original data source and reapply that onto the DataTable, like so:

        $('#test').click(function() {
            rowData[1].dep = "Mech"; // Update the value
            DT.fnUpdate(rowData[1],1); // Rebind the specific row
        })
    

    Hope this helps,

  • ronnjoeronnjoe Posts: 4Questions: 2Answers: 0

    Hi Ashbjorn,

    Thanks for your help and it actually worked out well for me. Your suggestion made me think in another direction and updated the aoData index and appending to the table

    Thanks,
    Joe

This discussion has been closed.