Nested Table is not working when data is bind dynamically to table

Nested Table is not working when data is bind dynamically to table

madhandonthamadhandontha Posts: 1Questions: 1Answers: 0

Hi,

I am trying to implement the Nested table feature using datatable API 'fnOpen'.

It is working well if I put table body content in a static way. But when the table body is added dynamically and tried to open the nested table, It is given an error,

Cannot read property '0' of undefined.

Where I am going wrong? Request to help in sorting out the issue.

Here is my sample code,

$(document).on( 'click', '#pcamastertable tbody td img', function(){
var nTr = $(this).parents('tr')[0];
var sOut = " "; // inner table content
oTable.fnOpen(nTr, sOut, "details");
}

While debugging, found there is some problem at the following code in datatables.js

      this.fnOpen = function(a, b, c) {
            return this.api(!0).row(a).child(b, c).show().child()[0]
        }
This discussion has been closed.