table colStyle, cellStyle, html render

This commit is contained in:
Sebastian Frank
2017-09-01 19:28:51 +02:00
parent 1f86e58a86
commit d2cb821143
4 changed files with 53 additions and 12 deletions

View File

@@ -38,7 +38,13 @@ export default {
heading: 'ID',
prop: 'ID',
orderBy: 'id',
align: 'right'
align: 'right',
colStyle: {
width: '70px'
},
cellStyle: {
color: '#999'
}
}, {
heading: 'TLD',
prop: 'TLD',

View File

@@ -38,10 +38,50 @@ export default {
heading: 'ID',
prop: 'ID',
orderBy: 'id',
align: 'right'
align: 'right',
colStyle: {
width: '70px'
},
cellStyle: {
color: "#999"
}
}, {
heading: 'Benutzertyp',
render(row) {
switch (row.Type) {
case 0: return 'Administrator';
case 1: return 'Reseller';
case 2: return 'Endkunde';
}
},
orderBy: 'type',
align: 'left',
cellStyle(row) {
switch (row.Type) {
case 0: return {color: 'red'};
case 1: return {color: 'orange'};
case 2: return {color: 'green'};
}
}
}, {
heading: 'Benutzername',
prop: 'Username',
render(row) {
let reseller = row.Reseller;
if (reseller) {
if (reseller.Company) {
reseller = reseller.Company;
} else if (reseller.Lastname) {
reseller = reseller.Firstname + reseller.Lastname;
} else {
reseller = reseller.Username;
}
reseller = '<br><span style="font-size: 0.8em; color: #999">Reseller: ' + reseller + '</style>';
} else {
reseller = '';
}
return row.Username + reseller;
},
orderBy: 'username',
align: 'left'
}, {
@@ -60,14 +100,6 @@ export default {
heading: 'Email',
prop: 'Email',
orderBy: 'email'
}, {
heading: 'Reseller',
prop: 'Reseller.Username'
}, {
heading: 'Render',
render(row) {
return '<b>ID:</b>' + row.ID;
}
}],
newRows: [ ],
hasMore: true,