drawCallback and child().show vs legacy fnOpen
drawCallback and child().show vs legacy fnOpen
Muhahe
Posts: 25Questions: 8Answers: 2
Hi, im confused about behavior of drawCallback and child().show.
Im using createdRow callback to open child row for parent row like this
"createdRow": function (row,data,index){
if(data.child != null){
var td = $('td', row).eq(0)
td.addClass('details-control')
try{
if (showHideItems['p'+data.id] ==true){
subtablesId.push('p'+data.id)
var tr = td.closest('tr');
var nRow = this.api().row( tr );
var elem = format(nRow.data())
nRow.child(elem).show();
tr.addClass('shown');
}
}catch(err){
//for IE
}
}
},
and if i try to reach child row in drawCallback, it isnt here
"drawCallback": function(settings){
if (settings._bInitComplete){
subtablesId.forEach(function(subtableId){
try{
initializeSubTable($('#subtable_'+subtableId),allTasksData[subtableId])
}catch(error){}
})
}
},
So child rows appear after drawCallback? or am i missing something? Or is here another callback which is called at same times as drawCallback, but with child().show row visible?
Im 1.9.2 datatables, i was using fnOpen instead of child(),show and new row was here in drawCallback.
This discussion has been closed.