var item = { name: "item", displayName: resourceFactory.getResource("Labels", "item"), canShowColumn: function () { return $scope.searchParameters.itemId !== 0 || $scope.showSearchControls; } }; var categories = [ { name: "category", displayName: resourceFactory.getResource("Labels", "category") }, { name: "subCategory", displayName: resourceFactory.getResource("Labels", "subCategory"), canShowColumn: function () { return $scope.searchParameters.categoryId !== 0 || $scope.searchParameters.subCategoryId !== 0 || $scope.showSearchControls; } }, { name: "blockHoldExpires", displayName: resourceFactory.getResource("Labels", "blockHoldExpires"), canShowColumn: function () { return $scope.searchParameters.categoryId !== 0 || $scope.searchParameters.subCategoryId !== 0 || $scope.showSearchControls; }, canShowValue: function (result) { return result.type === 8; }, filter: function (result) { return result.bHoldDays + " " + (result.bHoldDays === 1 ? variables.day : variables.days) + variables.priorAt + " " + result.bHoldExpires; } }, { name: "allowItemSaleAfterExpire", displayName: resourceFactory.getResource("Labels", "allowItemSaleAfterExpire"), canShowColumn: function () { return $scope.searchParameters.categoryId !== 0 || $scope.searchParameters.subCategoryId !== 0 || $scope.showSearchControls; }, canShowValue: function (result) { return result.type === 8; }, filter: function (result) { return result.allowItemSaleAfterExpire === 1 ? variables.yes : variables.no; } } ]; var tableDefinition = [ { name: "typeDescription", displayName: resourceFactory.getResource("Labels", "type"), canShowColumn: true, colClasses: "twoHundred" }, { name: "startTime", displayName: resourceFactory.getResource("Labels", "startTime"), canShowColumn: true, filter: function (result) { var date = moment(result.startTime); if (date.isValid()) { return date.format("MM/DD/YYYY HH:mm:ss"); } return ""; } }, { name: "endTime", displayName: resourceFactory.getResource("Labels", "endTime"), canShowColumn: true, filter: function (result) { var date = moment(result.endTime); if (date.isValid()) { return date.format("MM/DD/YYYY HH:mm:ss"); } return ""; } }, { name: "numberOfDays", displayName: "# " + resourceFactory.getResource("Labels", "days"), canShowColumn: true, colClasses: "seventyFive" }, { name: "maxSale", displayName: resourceFactory.getResource("Labels", "max"), canShowColumn: true }, { name: "department", displayName: resourceFactory.getResource("Labels", "department"), canShowColumn: true, colClasses: "hundredFifty" } ]; if ($scope.showSearchControls) { $log.info('Adding categories and item into grid'); sortColumn = "typeDescription"; tableDefinition.concat(categories).push(item); } else if (isCategoriesExtras) { tableDefinition.concat(categories); if (isItemExtras) { tableDefinition.push(item); } }I can see that this line of code is executing:
if ($scope.showSearchControls) { $log.info('Adding categories and item into grid'); sortColumn = "typeDescription"; tableDefinition.concat(categories).push(item);but then I display the tableDefinition and it is still 6 original items.