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:
parent
e43c780ba3
commit
3c055ebeaa
1 changed files with 9 additions and 1 deletions
|
@ -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>
|
||||
|
|
Loading…
Add table
Reference in a new issue