Skip to content

Commit

Permalink
Fix of tabulator.min.css to enable (node-red#36)
Browse files Browse the repository at this point in the history
* Try to fix the hight / scrolbar problem

* ui_control can be set by multiple msgs + example

* Bugfix headerVisible in tabulator.min.css

* Bugfix headerVisble (version 0.3.3)

* Turn off autoColumns if configured via ui_control
  • Loading branch information
Christian-Me authored Jul 18, 2020
1 parent 073569e commit 9d14220
Show file tree
Hide file tree
Showing 5 changed files with 55 additions and 14 deletions.
52 changes: 42 additions & 10 deletions node-red-node-ui-table/examples/6 ui_control interactive.json
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@
"payloadType": "str",
"topic": "rowFormatter",
"x": 280,
"y": 561,
"y": 629,
"wires": [
[
"16664cef.5b26b3"
Expand Down Expand Up @@ -230,7 +230,7 @@
"payloadType": "str",
"topic": "tooltips",
"x": 270,
"y": 663,
"y": 731,
"wires": [
[
"16664cef.5b26b3"
Expand All @@ -256,7 +256,7 @@
"payloadType": "json",
"topic": "tooltips",
"x": 270,
"y": 697,
"y": 765,
"wires": [
[
"16664cef.5b26b3"
Expand All @@ -282,7 +282,7 @@
"payloadType": "json",
"topic": "columns",
"x": 280,
"y": 765,
"y": 833,
"wires": [
[
"16664cef.5b26b3"
Expand Down Expand Up @@ -332,7 +332,7 @@
"payloadType": "json",
"topic": "columns",
"x": 270,
"y": 799,
"y": 867,
"wires": [
[
"16664cef.5b26b3"
Expand All @@ -358,7 +358,7 @@
"payloadType": "json",
"topic": "columns",
"x": 270,
"y": 867,
"y": 935,
"wires": [
[
"16664cef.5b26b3"
Expand All @@ -384,7 +384,7 @@
"payloadType": "json",
"topic": "columns",
"x": 250,
"y": 901,
"y": 969,
"wires": [
[
"16664cef.5b26b3"
Expand All @@ -403,11 +403,12 @@
"crontab": "",
"once": true,
"onceDelay": 0.1,
"x": 101,
"x": 84,
"y": 493,
"wires": [
[
"75207e8d.c54d4"
"75207e8d.c54d4",
"bd3fd382.a2aa9"
]
]
},
Expand All @@ -430,7 +431,38 @@
"payloadType": "json",
"topic": "rowFormatter",
"x": 270,
"y": 595,
"y": 663,
"wires": [
[
"16664cef.5b26b3"
]
]
},
{
"id": "bd3fd382.a2aa9",
"type": "ui_switch",
"z": "c4712650.59b5e8",
"name": "headerVisible",
"label": "headerVisible",
"tooltip": "",
"group": "ff9fdb9a.7da098",
"order": 7,
"width": 0,
"height": 0,
"passthru": true,
"decouple": "false",
"topic": "headerVisible",
"style": "",
"onvalue": "true",
"onvalueType": "bool",
"onicon": "",
"oncolor": "",
"offvalue": "false",
"offvalueType": "bool",
"officon": "",
"offcolor": "",
"x": 250,
"y": 544,
"wires": [
[
"16664cef.5b26b3"
Expand Down
5 changes: 3 additions & 2 deletions node-red-node-ui-table/lib/css/tabulator.min.css

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions node-red-node-ui-table/lib/css/tabulator.min.css.map

Large diffs are not rendered by default.

9 changes: 8 additions & 1 deletion node-red-node-ui-table/node.js
Original file line number Diff line number Diff line change
Expand Up @@ -97,10 +97,12 @@ module.exports = function (RED) {
// to make msg.ui_control work without msg.payload we have to send msg.payload=null.
// we correct this here into undefined to get the last known payload form currentValues[opt.node.id].
convert: function (value) {
if (value===null) { value=undefined; }
if (value===null) value=undefined;
return value;
},
// merge new ui_control messages into config.ui_control
// Help needed: use the already build in ui_control mechanism from ui.js

beforeEmit: function (msg, value) {
// cache ui_control messages for new clients
if (msg.hasOwnProperty('ui_control')) {
Expand Down Expand Up @@ -185,6 +187,11 @@ module.exports = function (RED) {
$scope.send({topic:cell.getField(), payload:cell.getData(), row:(cell.getRow()).getPosition()});
};
}

//turn autoColumns off if opts.columns is array with length > 0
if (opts.columns && Array.isArray(opts.columns) && opts.columns.length>0) {
opts.autoColumns = false;
}
// console.log("createTabulator",opts);
$scope.table = new Tabulator(basediv, 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.2",
"version": "0.3.3",
"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 9d14220

Please sign in to comment.