Event after responsive detail render
Event after responsive detail render
yu yen kan
Posts: 65Questions: 31Answers: 0
responsive: {
details: {
renderer: function (api, rowIdx, columns) {
var data = $.map(columns, function (col, i) {
return col.hidden ?
'<tr data-dt-row="' + col.rowIndex + '" data-dt-column="' + col.columnIndex + '">' +
'<td>' + col.title + ':' + '</td> ' +
'<td>' + col.data + '</td>' +
'</tr>' :
'';
}).join('');
var row = requestTable.row(rowIdx);
data += '<tr>' +
'<td>' +
'<table cellpadding="5" cellspacing="0" border="0" style="width:100%" id="table+ row.data().id + '">' +
'</table>' +
'</td>' +
'</tr>';
// initSubTable(row);
return data ?
$('<table/>').append(data) :
false;
}
}
},
I trying to add sub table on responsive detail view, is there any event execute after detail view render?
This discussion has been closed.
Answers
I can render sub table with following code
but after I render sub table, the responsive effect gone and I get this error
and the detail view is not longer work after 1st expand
The
responsive-display
event is triggered when the child row is altered. You could use that to initialise a Javascript control inside of it.Allan
tried responsive-display event, unfortunately, when I tried to initialize the datatable in child view, the detail.render is trigger again and the output is replaced
from the log of responsive-display event, when 1st render is received and I initialize the sub table by
to avoid infinity loop, 2nd event is triggered after I initialize sub table
Just to confirm, are you saying that with the above it works for you?
Allan
sample3 is before show detail view,
sample1 is after show detail view,
sample2 is after show detail view and resized window
work only on 1st click on detail view, after that it cannot be click anymore to show/hide detail view