Is row.add() capable of adding row below the cell it is called?
Is row.add() capable of adding row below the cell it is called?
qwertymota
Posts: 3Questions: 1Answers: 0
for example i have 4 rows on a table.. then when i click add on the 2nd row.. i want the newly added row to the 3rd row. and the others cells will move down..is this possible in datatables?
This discussion has been closed.
Answers
If you have a button or link within a cell in a row which is adding a row when clicked similar to the demo at http://datatables.net/examples/api/add_row.html
You should be able to modify the
add.row
function to use jQueryinsertAfter
orafter
function. Maybe usingthis
in jQuery, or traverse up the dom to get the firsttr
and insert after.the link is broken dude.
and :
im using newRow.insertAfter($(this).closest("tr"));
it will add rows in my table but it doesnt affect the row count in datatables.. how to re- draw(); the table for the pagination to be applied to the updated table with new row
BUMP!.
really need this
The link just needs the
.
at the end to be removed to make it correct.Won't work, as explained in the FAQs.
The short answer is no - row ordering in the table is applied only by the ordering rules that are applied to the table. So if you want a row to appear in a particular position, the data in the table, when sorted, needs to put that row into that position. You can apply a custom sort to achieve that if required. See this example for how to write a plug-in sorting function.
Allan