Get Row data in html form
Get Row data in html form
Nagma Khan
Posts: 4Questions: 1Answers: 0
I have a DataTable i which I have created button in each row
onclick of that button the row data should be fetched in html form
This discussion has been closed.
Answers
Reply as soon as possible
Maybe the
row().node()
API will do what you want.Kevin
Thank you for a reply..
row().node() is use to add a class
here i need a code to get row data from DataTable and set them to html fom
Sorry misunderstood your question. Checkout this JS Bin, provided by someone else. The code provides an example of getting data from the row selected when clicking a button in that row.
But there is a problem with the code in that when the data is loaded via ajax the buttons don't work. Discussion can be found here. Maybe you can find the answer.
Kevin
There are a couple of options:
row().data()
would provide the data for the row. If you needed the HTML cells for the row you could usecells().nodes()
.Allan
thank you all
but that JS Bin is not working and cells().node() is used to Find cells with a jQuery contains selector and add a class and I need code to get DataTable row Data to set in html form field on click of button
row().data()
.You would need to provide a link to a test case showing the issue if you need any further help.
Allan