Clickable row Server side not working
Clickable row Server side not working
Hi
I want to click on a row and give all details of that row.
I tried with example code but it isn't working.
[code]
var oTable = $('#clients').DataTable({
"sAjaxSource": "/data/clients",
"sAjaxDataProp": "",
"order": [[ 0, "asc" ]],
"aoColumns": [
{ "mData": "id"},
{ "mData": "name" },
],
"processing": true,
"serverSide": true
});
$('#clients tbody').on('click', 'tr', function () {
var aData = oTable.fnGetData(this);
alert(aData[0]);
});
[/code]
This question has an accepted answers - jump to answer
Answers
Can you link to the example you are following?
I tried a lot of examples:
* https://datatables.net/examples/advanced_init/events_live.html
* https://datatables.net/examples/server_side/row_details.html
* https://community.spiceworks.com/topic/1158822-selecting-a-row-with-jquery-datatables
It is working because Chrome didn't update my javascript file so I needed to delete cache.
No need to delete the entire Cache in Chrome.
Open the developer Console (Inspect Element)
Click and hold the Refresh Button, and Select "Hard Reload" or "Empty Cache and Hard Reload"