1
0
Fork 0
mirror of https://git.rwth-aachen.de/acs/public/villas/web/ synced 2025-03-16 00:00:03 +01:00

Table Widget now displays 'no entries' when it contains no elements

This commit is contained in:
Laura Fuentes Grau 2020-04-19 19:56:06 +02:00
parent e43c780ba3
commit 3c055ebeaa

View file

@ -92,6 +92,14 @@ class WidgetTable extends Component {
}
render() {
let rows = this.state.rows;
if(rows.length === 0){
rows.push({
name: "no entries"
})
}
var columns = [
<TableColumn key={1} title="Signal" dataKey="name" width={120} />,
<TableColumn key={2} title="Value" dataKey="value" modifier={format('.4s')} />
@ -102,7 +110,7 @@ class WidgetTable extends Component {
return (
<div className="table-widget">
<Table data={this.state.rows}>
<Table data={rows}>
{ columns }
</Table>
</div>