Ok so I have a Jquery json call. It looks somewhat like this.
$('#StockInvetoryReportList').dataTable({
"filter": false,
"bLengthChange": false,
"bPaginate": false,
"bProcessing": true,
"bServerSide": true,
"sAjaxSource": "@Url.Action("GetStockInventoryBalance", "Reports")",
"aoColumns": [{ "mData": "Date"},
{ "mData": "Name" },
{ "mData": "Quantity" },
{ "mData": "isSummary" }
],
"fnServerParams": function (aoData) {
aoData.push({ "name" : "StockNo", "value": $('#MaterialName').val() }),
{ "name": "ReportDate", "value": $('#ReportDate').val() };
}
});
And it generates this table:
+------------+---------+----------+------------+
| Date | Name | Quantity | Is Summary |
+------------+---------+----------+------------+
| 10/01/2015 | Wire | 500 | False |
+------------+---------+----------+------------+
| 10/05/2015 | Wire | 500 | False |
+------------+---------+----------+------------+
| 10/15/2015 | Wire | 600 | False |
+------------+---------+----------+------------+
| 10/18/2015 | Wire | 100 | False |
+------------+---------+----------+------------+
| 10/19/2015 | Wire | 200 | False |
+------------+---------+----------+------------+
| 10/31/2015 | October | 1900 | True |
+------------+---------+----------+------------+
I want to merge the first 2 columns if is summary is true. It should look like this.
+------------+------+----------+------------+
| Date | Name | Quantity | Is Summary |
+------------+------+----------+------------+
| 10/01/2015 | Wire | 500 | False |
+------------+------+----------+------------+
| 10/05/2015 | Wire | 500 | False |
+------------+------+----------+------------+
| 10/15/2015 | Wire | 600 | False |
+------------+------+----------+------------+
| 10/18/2015 | Wire | 100 | False |
+------------+------+----------+------------+
| 10/19/2015 | Wire | 200 | False |
+------------+------+----------+------------+
| October | 1900 | True |
+-------------------+----------+------------+
And of course there would be more months in the list. Your help would be greatly appreciated