I am creating a custom section in umbraco backoffice in an v13 installation, and I am currently making a custom section dashboard. In this dashboard I am using umb-table and populating it with data. The problem is there is a “Name” column that is always there no matter what I do.
Data is just random mock data for the example. I am at a loss as to how to remove this column.
Code, I have removed some names for privacy sake.
html
<div ng-controller="mycontroller as vm">
<umb-load-indicator ng-if="vm.loading"></umb-load-indicator>
<umb-box ng-if="!vm.loading">
<umb-box-content ng-if="vm.items.length == 0">
<h4>No current orders</h4>
</umb-box-content>
<umb-box-content ng-if="vm.items.length > 0">
<umb-table items="vm.items" item-properties="vm.options.includeProperties">
</umb-table>
</umb-box-content>
</umb-box>
</div>
controller js file:
(function (window) {
"use strict";
var angular = window.angular;
function myController($scope, $routeParams, $filter, editorService, autoitB2BResource) {
var vm = this;
vm.items = [];
vm.options = {
includeProperties: [
{ alias: "Id", header: "Id" },
{ alias: "OrderNumber", header: "Order number" },
{ alias: "OrderDate", header: "Order date" },
{ alias: "TotalAmount", header: "bla bla bla" }
]
};
vm.columns = [
{
name: "Id",
alias: "Id",
isSystem: false
},
{
name: "Order Number",
alias: "OrderNumber",
isSystem: false
},
{
name: "Order Date",
alias: "OrderDate",
isSystem: false
},
{
name: "Total Amount",
alias: "TotalAmount",
isSystem: false
}
];
vm.loading = true;
function map(item) {
return {
Id: item.id,
OrderNumber: item.orderNumber,
OrderDate: item.orderDate
? $filter('date')(item.orderDate, 'dd-MM-yyyy')
: '',
TotalAmount: item.totalAmount
};
}
function loadOrders() {
vm.loading = true;
myResource.getCustomerOrders().then(function (response) {
console.log(response);
//vm.items = response.map(map);
vm.items = response;
vm.loading = false;
}, function () {
vm.items = [];
vm.loading = false;
});
}
loadOrders();
}
angular.module("umbraco").controller("myController", myController);
})(window);
