Guys,
I tagged onto the back of a previous message with Examples about ui_Table, templates etc
What i am trying do i thought would be pretty simple
Essentially my electricity provider gives me 5 minute pricing offset 1 minute past the hour - so 9:01, 9:06, 9:11 in 1/2 hour blocks and then they reset and start again.
I want to present this information in a table that would look something like this
I can understand how to use NG-Repeat to cycle through an array of data and put it in the table, and a crude approach would be to simply have two elements in the array with Price and Time as the first two items in the two array elements, and then add the price and times to the elements as they come in - but this feels rather crude
Is there not a way to have the Headers for a table down the side - rather than across the top ?
I have not worked with Tabulator, Angular and Ng-repeat before so its been an uphill battle to this point.
And here is the example i am playing around with
[{"id":"81b95d62.bfbb1","type":"inject","z":"77c34825.37bd58","name":"Go","repeat":"","crontab":"","once":false,"onceDelay":"","topic":"","payload":"1","payloadType":"str","x":310,"y":140,"wires":[["59dac1d9.b8de6"]]},{"id":"59dac1d9.b8de6","type":"function","z":"77c34825.37bd58","name":"build array (2)","func":"var arr =[[\"Price\",17,24,15,16,16,18],[\"Time\",\"13:01\",\"13:06\",\"13:11\",\"13:16\",\"13:21\",\"13:26\"]];\nmsg.payload = arr;\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":480,"y":140,"wires":[["ffa391c5.78cbe"]]},{"id":"44c5693a.086dd8","type":"debug","z":"77c34825.37bd58","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":1010,"y":140,"wires":[]},{"id":"ffa391c5.78cbe","type":"ui_template","z":"77c34825.37bd58","group":"6d14f4ec.23f8fc","name":"Two dimension array table","order":1,"width":"6","height":"6","format":"<table id=\"table\" border=\"1\">\n <caption>Caption</caption>\n <tr>\n <th></th> \n <th>Period 1</th> \n <th>Period 2</th>\n <th>Period 3</th>\n <th>Period 4</th>\n <th>Period 5</th>\n <th>Period 6</th>\n </tr>\n <tbody>\n <tr ng-repeat=\"row in msg.payload\">\n <td ng-repeat=\"item in row\" >{{item}}</td>\n </tr>\n </tbody>\n</table>\n\n","storeOutMessages":false,"fwdInMessages":true,"resendOnRefresh":false,"templateScope":"local","x":700,"y":140,"wires":[["44c5693a.086dd8"]]},{"id":"6d14f4ec.23f8fc","type":"ui_group","name":"Default","tab":"40a21688.635fe8","order":1,"disp":true,"width":"6"},{"id":"40a21688.635fe8","type":"ui_tab","name":"Home","icon":"dashboard","order":9}]
Two issues with this
- It seems crude to include the two row names as part of the array
- It is dropping my first Row for some reason
Craig