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

have this function to the new version editor?

$
0
0

jQuery.fn.dataTable.Api.register('row.addByPos()', function(data, index) {
var currentPage = this.page();

//insert the row
this.row.add(data);

    //move added row to desired index
    var rowCount = this.data().length-1,
        insertedRow = this.row(rowCount).data(),
        tempRow;

    for (var i=rowCount;i>=index;i--) {
        tempRow = this.row(i-1).data();
        this.row(i).data(tempRow);
        this.row(i-1).data(insertedRow);
    }

    //refresh the current page
    this.page(currentPage).draw(false);
});

Viewing all articles
Browse latest Browse all 2364

Trending Articles