Post Method onClick with Popup
Post Method onClick with Popup
![klay20](https://secure.gravatar.com/avatar/74037c7bd0bedf1978b48f204a15556e/?default=https%3A%2F%2Fvanillicon.com%2F74037c7bd0bedf1978b48f204a15556e_200.png&rating=g&size=120)
in Extensions
Hi everyone,
Im getting my data from api, and i want when i click a button on my table a popup will open and i will send several data to my db.
How can i achieve that? Is there any solution or example about post method with popup on datatable?
Answers
Forms and posting back wouldn't be provided by DataTables, but you could create a custom button using the Buttons extension that triggers that code.
Colin
Thanks, i've already these;
$('#myTable').DataTable( {
buttons: [
'open', 'excel', 'pdf'
]
} );
But how can i access to "open" button for manipulate with functions?
You would use the
action
function - see example here. There it's just creating an alert, but you could have your form instead.Colin
I need a button for open popup in every single row at table. Is that possible with datatable? Or should i use javascript?
This example shows how to create a click event handler for the rows. The example shows how to get the row data. Creating an edit form that can be submitted via ajax is not built into Datatables. You will need to write this code or you can purchase the Editor which has this functionality.
Kevin
I added to document.ready function on index
The incoming data value from api in react js, it doesnt work.
Is that problem rendering data on datatables with this function?
Should i add this code in rendering js part or another?