So I have a jquery json call. It looks something 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 combine the first 2 columns if the 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 will be more months on the list. Your help will be greatly appreciated.
source share