Christian-Me / remote-device-table

Node-RED flow to display the status of remote devices on the dashboard using ui-table
Apache License 2.0
16 stars 10 forks source link

Table is not populated #3

Closed ChankyTheConqueror closed 2 years ago

ChankyTheConqueror commented 2 years ago

Hi, im trying out your ui-table handler. I've managed to feed in data and i can see that tableData is updated correctly, my only concern, is that even though i have connected an ui-table to the handler, the table is always empty. Im i missing something?

image image

Thanks in advance!

ChankyTheConqueror commented 2 years ago

my problem was using msg.payload for the row data, i assumed it doesn't matter where the raw data but it seem to matter. My solution was to move msg.payload to msg.state and now a table is created. image image but now i have the next problem despite my index being unique (state.device) new row entries are added to the table instead of replacing the old values. What is the issue here?

ChankyTheConqueror commented 2 years ago

the problem here was because the index in the tabulator was not matching my column, image

and also index should be device and not state.device.

Christian-Me commented 2 years ago

Hi @ChankyTheConqueror sorry but I was not looking into github for a while.

Looks like you solved your problem. I had a look into the code after years and was shocked - my own legacy code. Even I use this subflow a lot (with all my tables) it would be very painful to fix things.

I hope it works now and is perhaps useful.

About year ago i added support for tree structured tables .... (drop me a note when you need this)

image

Happy Holidays

ChankyTheConqueror commented 2 years ago

Hi Christian, now it's working properly, a tree structured table would be quite nice. I can then group all my devices in rooms. do you have a subflow which i can use ;-)

Best regards

Christian-Me commented 2 years ago

Perhaps this demo could help (contains the latest version of the subflow) and some demo data. I like the tree view but be aware that the columns are consistent for all children. I would like to implement something like an average, min or max for the parent rows but didn't found time to dig into that (you see the 0% figures). But it should be possible

tree-demo.json

ChankyTheConqueror commented 2 years ago

Hi Christian,

I tried the demo today, it isn't populating the table ,despite injecting data with the inject node. Also tableData is empty

image

image

image

Best regards