How to create new row at middle of the table

How to create new row at middle of the table

dhanudhanu Posts: 12Questions: 0Answers: 0
edited February 2014 in DataTables 1.9
I am using datatables 1.9.4 version,
how to create new row at middle of the table
i tried based on http://datatables.net/forums/discussion/11899/unable-to-add-row-in-the-middle-of-a-data-table/p1
but not working.

Replies

  • tangerinetangerine Posts: 3,365Questions: 39Answers: 395
    http://datatables.net/forums/discussion/12899/post-test-cases-when-asking-for-help-please-read
  • dhanudhanu Posts: 12Questions: 0Answers: 0
    $(document).ready( function () {

    $("#sellIn").dataTable({
    "sPaginationType": "full_numbers",
    "bPaginate": true,
    "bJQueryUI": true,
    "bAutoWidth": true,
    "bFilter": false,
    "bSort":false,
    "aaSorting": [[0,'asc']],
    "aaSortingFixed":[ [0,'asc']],
    "aoColumnDefs": [
    { "bSortable": false, "aTargets": [ 0 ] }
    ]

    });

    var oTable = $("#sellIn").dataTable();
    var oSettings = oTable.fnSettings();
    var oData = $('#sellIn').dataTable().fnSettings().aoData;
    var oDisplayMaster = $('#sellIn').dataTable().fnSettings().aiDisplayMaster;
    var oDisplay =$('#sellIn').dataTable().fnSettings().aiDisplayMaster;
    var affectedRowNbr = 1; //childTd.parentNode.parentNode.rowIndex-1;
    var ind = affectedRowNbr+1;

    var newTr = " ";
    newTr += "test0test1test2test3test4test5";
    newTr += "";

    var nTr = $(newTr)[0];
    var nTds = nTr.getElementsByTagName("td");
    var aData = [];
    for ( var j=0 ; j
  • dhanudhanu Posts: 12Questions: 0Answers: 0
    http://jsfiddle.net/dhanu/C5z86/
This discussion has been closed.