From 77d879d668128041a6348b39834d4822343c0a43 Mon Sep 17 00:00:00 2001 From: Marco P Date: Fri, 13 Sep 2019 12:12:46 +0200 Subject: [PATCH] merge cells containing complex values (objects, arrays) --- dataTables.rowsGroup.js | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/dataTables.rowsGroup.js b/dataTables.rowsGroup.js index d82a2ed..cb155da 100644 --- a/dataTables.rowsGroup.js +++ b/dataTables.rowsGroup.js @@ -199,8 +199,18 @@ RowsGroup.prototype = { var newSequenceRow = iStartRow, iRow; for (iRow = iStartRow + 1; iRow <= iFinishRow; ++iRow) { + //added to handle complex values (objects, arrays) + var curValue = null; + var nextValue = null; + if (typeof columnValues[iRow] === "object") { + curValue = JSON.stringify(columnValues[iRow]); + nextValue = JSON.stringify(columnValues[newSequenceRow]); + } else { + curValue = columnValues[iRow]; + nextValue = columnValues[newSequenceRow]; + } - if (columnValues[iRow] === columnValues[newSequenceRow]) { + if (curValue === nextValue) { $(columnNodes[iRow]).hide() } else { $(columnNodes[newSequenceRow]).show()