Skip to content

Commit

Permalink
Fix ui-table background colour when no data
Browse files Browse the repository at this point in the history
  • Loading branch information
Dave Conway-Jones committed Jul 26, 2020
1 parent 9d14220 commit b15cd55
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions node-red-node-ui-table/node.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ module.exports = function (RED) {
var html = String.raw`
<link href='ui-table/css/tabulator`+mid+`.min.css' rel='stylesheet' type='text/css'>
<script type='text/javascript' src='ui-table/js/tabulator.js'></script>
<div id='ui_table-{{$id}}'></div>
<div id='ui_table-{{$id}}' style="background-color:unset; border:unset;"></div>
<input type='hidden' ng-init='init(` + configAsJson + `)'>
`;
return html;
Expand Down Expand Up @@ -148,7 +148,7 @@ module.exports = function (RED) {

var createTable = function(basediv, tabledata, columndata, outputs, ui_control) {
// add id field if not already exists
if (tabledata.length>0 && tabledata[0] && typeof tabledata[0] === 'object' && !tabledata[0].hasOwnProperty('id')) {
if (columndata.length>0 && tabledata.length>0 && tabledata[0] && typeof tabledata[0] === 'object' && !tabledata[0].hasOwnProperty('id')) {
tabledata.map((row,index) => row.id = index);
}
var opts = {
Expand Down
2 changes: 1 addition & 1 deletion node-red-node-ui-table/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "node-red-node-ui-table",
"version": "0.3.3",
"version": "0.3.4",
"description": "Table UI widget node for Node-RED Dashboard",
"author": "Kazuhito Yokoi",
"contributors": ["Dave Conway-Jones","@hotNipi","@Christian-Me"],
Expand Down

0 comments on commit b15cd55

Please sign in to comment.