My Issue:
I am working on a project which is related to DataTableJS. I need a row grouping feature and It\'s separated with grouped rows. Just I want to
First I tried https://datatables.net/examples/api/row_details.html, but it was not rendered as I expected.
Therefore I implemented it myself:
JS
$(document).ready(function () {
......
$('.datatable-header-footer').on('draw.dt', function () {
bindRowToggle();
});
$('.datatable-header-footer').on('processing.dt', function () {
bindRowToggle();
});
$('.datatable-header-footer').on('search.dt', function () {
bindRowToggle();
});
bindRowToggle();
});
function bindRowToggle() {
$('tr.parentOrder').click(function () {
$(this).nextAll(':lt(2)').toggle();
});
}
CSS
.parentOrder {
}
.childOrder {
display: none;
}
HTML
...
- 热议问题