EXAMPLE (template) - displaying a two dimensional table


#21

As "contenteditable" is not part of angular but is part of html, it might not be the solution you're looking for:

Searching for "angular edit table double click" returns interesting links such as:


#22

umm how about 'contenteditable edge not working'?


#23

Thank you for putting me in the right direction.
I am thinking about how to export the content of the table by clickinng on a button which is not part of the UI template. This button would send an empty message payload and a special topic value (for instance "Save data") to trigger the send of the content of the table to the next node. I would use the "scope.$watch" function and when the topic is "Save data" the content of the table would be iterated and sent. The question that I have is when happens with the code that initializes the table using ng-repeat

<tr ng-repeat="row in msg.payload">
    <td id="Value1">{{row.Value1}}</td> 
    <td class="numeric" id="Value2" contenteditable="true" onclick = "this.contentEditable = true;">{{row.Value2}}</td>
 </tr>

How can I allow the execution of ng-repeat only when the message topic is for instance something like "Init table", and prevent the execution when the message topic is "Save data"?


#24

Nice table setup to search large database.I wanted use Json arrays as input to display data in array but I do not know how to revise template node to do it. Is it even possible ?
If So please give me some hint how to do it ? Json file will deliver more than 50 values in it's array which look like following:

{"System":{"Build":"RPIEasy 0.19.033","System libraries":"Python 3.5.3 (default, Sep 27 2018, 17:25:39) [GCC 6.3.0 20170516] Linux-4.14.79-v7+-armv7l-with-debian-9.6","Plugins":24,"Local time":"2019-02-09 12:26:09","Unit":1,"Name":"Livingroom","Uptime":82.45,"Load":23.53,"Free RAM":607395840.0},"WiFi":{"IP config":"DHCP","IP":"10.1.10.40","Subnet Mask":"255.255.255.0","Gateway IP":"10.1.10.1","MAC address":"b8:27:eb:be:61:e4","DNS 1":"10.1.10.1","SSID":"HTM","RSSI":-56},"Sensors":[{"TaskValues": [{"ValueNumber":1,"Name":"X","NrDecimals":0,"Value":509.0}],"DataAcquisition": [{"Controller":1,"IDX":-1,"Enabled":"False"},{"Controller":2,"IDX":-1,"Enabled":"False"},{"Controller":3,"IDX":-1,"Enabled":"False"},{"Controller":4,"IDX":-1,"Enabled":"False"}],"TaskInterval":2.0,"Type":"Extra IO - ProMini Extender (TESTING)","TaskName":"A1","TaskEnabled":"True","TaskNumber":1},{"TaskValues": [{"ValueNumber":1,"Name":"Y","NrDecimals":0,"Value":509.0}],"DataAcquisition": [{"Controller":1,"IDX":-1,"Enabled":"False"},{"Controller":2,"IDX":-1,"Enabled":"False"},{"Controller":3,"IDX":-1,"Enabled":"False"},{"Controller":4,"IDX":-1,"Enabled":"False"}],"TaskInterval":2.0,"Type":"Extra IO - ProMini Extender (TESTING)","TaskName":"A2","TaskEnabled":"True","TaskNumber":2},{"TaskValues": [{"ValueNumber":1,"Name":"Gesture","NrDecimals":0,"Value":0.0}],"DataAcquisition": [{"Controller":1,"IDX":-1,"Enabled":"False"},{"Controller":2,"IDX":-1,"Enabled":"True"},{"Controller":3,"IDX":-1,"Enabled":"False"},{"Controller":4,"IDX":-1,"Enabled":"False"}],"TaskInterval":0,"Type":"Input - APDS9960 Gesture sensor","TaskName":"9960","TaskEnabled":"True","TaskNumber":3},{"TaskValues": [],"DataAcquisition": [{"Controller":1,"IDX":-1,"Enabled":"False"},{"Controller":2,"IDX":-1,"Enabled":"False"},{"Controller":3,"IDX":-1,"Enabled":"False"},{"Controller":4,"IDX":-1,"Enabled":"False"}],"TaskInterval":1.0,"Type":"Display - Simple OLED","TaskName":"SSD1306","TaskEnabled":"True","TaskNumber":4},{"TaskValues": [{"ValueNumber":1,"Name":"ESPrms","NrDecimals":2,"Value":0.0}],"DataAcquisition": [{"Controller":1,"IDX":0,"Enabled":"True"},{"Controller":2,"IDX":-1,"Enabled":"False"},{"Controller":3,"IDX":-1,"Enabled":"False"},{"Controller":4,"IDX":-1,"Enabled":"False"}],"TaskInterval":2.0,"Type":"Extra IO - ProMini Extender (TESTING)","TaskName":"A30","TaskEnabled":"False","TaskNumber":5},{"TaskValues": [{"ValueNumber":1,"Name":"Volt","NrDecimals":2,"Value":5.09}],"DataAcquisition": [{"Controller":1,"IDX":-1,"Enabled":"False"},{"Controller":2,"IDX":-1,"Enabled":"False"},{"Controller":3,"IDX":-1,"Enabled":"False"},{"Controller":4,"IDX":-1,"Enabled":"False"}],"TaskInterval":2.0,"Type":"Extra IO - ProMini Extender (TESTING)","TaskName":"A0","TaskEnabled":"True","TaskNumber":6},{"TaskValues": [{"ValueNumber":1,"Name":"Data","NrDecimals":-1,"Value":"0"}],"DataAcquisition": [{"Controller":1,"IDX":-1,"Enabled":"False"},{"Controller":2,"IDX":-1,"Enabled":"False"},{"Controller":3,"IDX":-1,"Enabled":"False"},{"Controller":4,"IDX":-1,"Enabled":"False"}],"TaskInterval":60,"Type":"Communication - Serial (TESTING)","TaskName":"Serial","TaskEnabled":"False","TaskNumber":7},{"TaskValues": [{"ValueNumber":1,"Name":"Data","NrDecimals":0,"Value":0.0}],"DataAcquisition": [{"Controller":1,"IDX":-1,"Enabled":"False"},{"Controller":2,"IDX":-1,"Enabled":"False"},{"Controller":3,"IDX":-1,"Enabled":"False"},{"Controller":4,"IDX":-1,"Enabled":"False"}],"TaskInterval":60,"Type":"Input - Generic EvDev (TESTING)","TaskName":"","TaskEnabled":"False","TaskNumber":8},{"TaskValues": [{"ValueNumber":1,"Name":"pin","NrDecimals":0,"Value":7.0},{"ValueNumber":2,"Name":"dimvalue","NrDecimals":0,"Value":0.0},{"ValueNumber":3,"Name":"event","NrDecimals":0,"Value":0.0},{"ValueNumber":4,"Name":"Dummy4","NrDecimals":1,"Value":0.0}],"DataAcquisition": [{"Controller":1,"IDX":-1,"Enabled":"False"},{"Controller":2,"IDX":0,"Enabled":"False"},{"Controller":3,"IDX":-1,"Enabled":"False"},{"Controller":4,"IDX":-1,"Enabled":"False"}],"TaskInterval":0,"Type":"Generic - Dummy Device","TaskName":"dimmer","TaskEnabled":"True","TaskNumber":12},{"TaskValues": [{"ValueNumber":1,"Name":"uptime","NrDecimals":0,"Value":4944.0},{"ValueNumber":2,"Name":"rssi","NrDecimals":0,"Value":-56.0},{"ValueNumber":3,"Name":"ram","NrDecimals":0,"Value":604164.0},{"ValueNumber":4,"Name":"load","NrDecimals":0,"Value":41.0}],"DataAcquisition": [{"Controller":1,"IDX":-1,"Enabled":"False"},{"Controller":2,"IDX":0,"Enabled":"True"},{"Controller":3,"IDX":-1,"Enabled":"False"},{"Controller":4,"IDX":-1,"Enabled":"False"}],"TaskInterval":5.0,"Type":"Generic - System Info","TaskName":"sysinfo","TaskEnabled":"True","TaskNumber":16}],"TTL":1000.0}

#25

It would be a lot easier if you formatted your JSON above as code. Please read the following post How to share code or flow json and then edit the above message.


#26

Thank you for your help.I just became member couple of days ago.


#27

Theres a lot of other stuff in there that you don't need.
So personally I would add a debug node and find the piece that you do want.
See https://nodered.org/docs/user-guide/messages for how the debug node can help you work with messages.

Then you can use a change node to move the bit you are interested in to msg.payload.
That then should make it easier to follow the example in the first post of this thread.


#28

I know how to work with debug node and switch node to filter json. I was very specific about template node to understand how it would work with large json with lot of values as input.I tried to do it different ways for couple of hours before posting here.English is not my first language so may be I was not clear enough. May be original creator of table hugobox can help me understand the process in template node.

Thank you.


#29

The numbers of lines isn’t the issue it’s all the other data that isnt in the array. If you filter the JSON. so it only includes the parts you actually need it will make the code easier to understand.