Hassanj343 / jquery-datatables-editable

Automatically exported from code.google.com/p/jquery-datatables-editable
0 stars 0 forks source link

How to get ID of added row #86

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Add New row to a table

How can I get the ID of the added row?

Per the example, I return it from my php file ->   echo $id;

But how do I access the returned ID? I need to set it as a cookie and use it 
for other functions.

Original issue reported on code.google.com by vogelja...@aol.com on 18 Jan 2012 at 6:38

GoogleCodeExporter commented 9 years ago
is the ID of the added row available in fnOnAdding or fnOnAdded???

Original comment by ras...@gmail.com on 2 Feb 2012 at 7:23

GoogleCodeExporter commented 9 years ago
I had a similar need.  I solved it by overriding fnOnNewRowPosted, and having 
my function receive a json object; as I need more control over success/fail, 
etc.  You can override the fndOnNewRowPosted, get the id sent back from PHP and 
then you can set your cookie or whatever in that method.

Original comment by ven.re...@gmail.com on 4 Feb 2012 at 5:50

GoogleCodeExporter commented 9 years ago
Hi,

ven.reddy is right, you can see this function in heading of the editable plugin 
file:

* @fnOnNewRowPosted Function    function(data) 
Function that can override default function that is called when server-side 
sAddURL returns result. You can use this function to add different behaviour 
when server-side page returns result 

I will close this issue.

Thanks,
Jovan

Original comment by joc...@gmail.com on 9 Feb 2012 at 8:59