Modal show when dataTable row is clicked.
Modal show when dataTable row is clicked.
faridmcdato
Posts: 1Questions: 1Answers: 0
Good day guys,
I would like to ask how to make the modal pop up when a row in the dataTable was double clicked? After that the data of the clicked row will be received by the modal where one of the data is editable and other data are non-editable.
Please guide me how to do this specific problem. Sorry for being beginner and I`ll gratitude your kind help.
Thanks
This discussion has been closed.
Answers
var oTable = $('#example'). dataTable();
$('#example').on('click', 'tr', function(){
var oData = oTable.fnGetData(this);
console.log(oData);
});
or you can also chang rows
$('#example').on('click', 'tr', function(){
var oTable = $('#example'). dataTable();
var oData = oTable.fnGetData(this);
console.log(oData);
});
use oData in Ajax for make request