Adding Rows
Adding Rows
I have been searching but haven't found the exact solution to this. Is there a way to add new rows to the DataTable at the top instead of the bottom or is there a row to automatically scroll to the row that has been added?
My DataTable has no pagination.
thanks
My DataTable has no pagination.
thanks
This discussion has been closed.
Replies
Regarding scrolling to the row - I don't have a function to hand that would do that, but the principle is shown in this plug-in: http://datatables.net/plug-ins/api#fnAddDataAndDisplay . fnAddData gives you the information back that you need to address the new row - you can use standard jQuery methods to scroll to that node.
Allan
something like this, I think.
[code]
var obj = gObjTable.fnAddData([checkbox, name, acc, currentBalance, payment, balance, checkNo, status, pid, hasLateFees]);
var oSettings = gObjTable.fnSettings();
var nTr = oSettings.aoData[obj[0]].nTr;
$('select the Nth TD of the nTr object') .editable(......);
[/code]
is that what it is? I'm having a bit a of difficulty selecting the from that nTr object.
[code]
"fnCreatedRow" : function(nRow, aData, iDataInde)
{
//4 is the index of the column i'm interested in. I only wanted to make ONE column editable.
$('td:eq(4)', nRow).editable(function (value, settings){ ....... }
}
[/code]