Quantcast
Channel: DataTables 1.10 — DataTables forums
Viewing all articles
Browse latest Browse all 2367

Cell update

$
0
0

Hello,

I am migrating code from DataTables 1.8 to 1.10

Current 1.8 code:

oTable = $('.dataTable').dataTable();

                    //Loop through each checkbox checked and update
                    $(".Active_Checks:checked").each(function() {

                        var iId = $(this).parent().parent().attr("id"); /* Record ID */
                        var indexOfRow = oTable.fnGetPosition( $(this).closest('tr').get(0) );
                        var iStatus = object.value;

                        if (iStatus == "Add_MB") {
                            var iIcon = "<img src='/img/greenCheck.gif' border=0>";
                            oTable.fnUpdate( iIcon, indexOfRow, 2 );
                        }
                        if (iStatus == "Add_BP") {
                            var iIcon = "<img src='/img/Checkpurple.gif' border=0>";
                            oTable.fnUpdate( iIcon, indexOfRow, 3 );
                        }
                        if (iStatus == "Remove_MB") {
                            oTable.fnUpdate( "", indexOfRow, 2 );
                        }
                        if (iStatus == "Remove_BP") {
                            oTable.fnUpdate( "", indexOfRow, 3 );
                        }

                        jQuery.ajax({
                             type: "POST",
                             url: "/Online/docs_actions.lasso",
                             data: "status="+iStatus+"&row_id="+iId,
                             dataType: "html"
                         });
                    });
                    oTable.fnDraw();

I can't find a way to update the cell contents in 1.10. What's the best way to change the code?

Thank you in advance!

Jhonny


Viewing all articles
Browse latest Browse all 2367