In my project, I used jquery nested datatable, I have 2childs row for each row in datatble, below is my code
$(function(){$(document).on('click','#tab td.control', function(){
var nTr = this.parentNode;
var oData = $('#tab').dataTable().fnGetData(nTr);
console.log(oData);
.....etc.....
});
If you click the parent pointer td, two child lines will open, and this.parentNode will display the parent data of the node based on this information, I will show additional information about the parent node, below the code for the child line,
$(function(){$(document).on('click','table[id^="inner_param_"] td.control', function(){
var nTrs = this.parentNode;
var ooDatas = we.fnGetData(nTrs);
console.log(ooDatas);
.....etc.....
});
If I click on the parent node, the first child means that the child element is open, and the parent data of the node is displayed in the console, but the second child does not work, and the console shows null for the parent node details
source
share