MakeCellEditable Breaks ability to use RowGrouping and collapsing
MakeCellEditable Breaks ability to use RowGrouping and collapsing
MethodDev
Posts: 3Questions: 2Answers: 0
var collapsedGroups = {};
var table = $('#'+tblName +'').DataTable({
"paging": true,
"info": false,
"searching": false,
"lengthChange": false,
rowGroup: {
// Uses the 'row group' plugin
dataSrc: 1,
startRender: function (rows, group) {
var collapsed = !!collapsedGroups[group];
rows.nodes().each(function (r) {
r.style.display = collapsed ? 'none' : '';
});
return $('<tr/>')
.append('<td colspan="8">' + group + '</td>')
.attr('data-name', group)
.toggleClass('collapsed', collapsed);
}
}
});
/* Custodian Collapse/Expand Hold Rows Start */
$('#'+ tblName +' tbody').on('click', 'tr.group-start', function () {
var name = $(this).data('name');
collapsedGroups[name] = !collapsedGroups[name];
table.draw(false);
});
/* Custodian Collapse/Expand Hold Rows End */
table.MakeCellsEditable({});
The above code I have will allow me to click a cell then click out of it to edit but then it breaks my ability to hide/collapse the row group. If I remove the "table.MakeCellsEditable({});" then I can collapse/hide my grouped rows again.
Any idea on how to prevent this from breaking?
This discussion has been closed.
Answers
The MakeCellsEditable plugin is not a Datatables plugin. The code can be found here:
https://github.com/ejbeaty/CellEdit
Neither function you are doing is standard Datatables functionality. Without a test case its hard to say what the problem is. Please post a link to your page or a test case replicating the issue.
https://datatables.net/manual/tech-notes/10#How-to-provide-a-test-case
It may end up that they are not compatible. I would recommend posting an issue with the developer of MakeCellsEditable to see if they know.
Kevin