The table node I am using ends up disappearing after I refresh the UI page. The table node isn't able to connect with a node on the right, whereas the topics I see on the internet the table nodes they are able to connect on both sides.
the ui-table node only has an output if you set the "send data" option
otherwise there is nothing to send
How do you send data to your table? This determines if the data is refreshed by the dashboard on reload.
I send it via msg.payload, from a function node.
its goes something very similar to this:
> Blockquote
var tblmsg={}
tblmsg.payload={
"solution": "dataInput",
"attributes": [{"time": global.get('currenttime')}]
}
node. send(tblmsg);
}
return null;
Now this information does send having looked at when manually debugging. Not sure how to make it so that the information stays after refreshing or even after changing a page
There are two ways of feeding data into your table.
- The simple / normal way sending a array (rows) of objects (columns) like
msg.payload = [
{"col1":1,"col2":"Name"},
{"col1":2,"col2":"another Name"}
]
this fills the table with data. The data is cached by the daschboard and will be replayed for new clients or page refresh.
- or by sending (many) commands: like (this will add another row to your table)
msg.payload = {
"command":"addData",
"arguments":[
{
"col1":1,
"col2":"name"
},
true
],
"returnPromise":true
}
}
but in this case the data is not cached and you have to resend it if you refresh your browser or a new client connects as noted in the docs:
important notices
Data which is sent to ui-table through commands is not cached by ui-table! The flow has to take care to update the table for new clients connection or dashboard tab changes!
This makes ui-table very versatile able to manipulate data on cell level but also a little bit more complicated.
Your example should not work at all (sending a object not following the "command" "arguments" "returnPromise" scheme.
Can you give me an example how to addRow but still cache it?
-> How can I add a row and have persistent data over page reloads and reconnections?