Etable is empty on browser refresh (node-red-contrib-ui-etable)

I removed the options and columns json entry from node's properties and I coded into a function node as msg.config. Unfortunatly table is empty every time I load tab or refresh it.
Table shows data when I press a connected button or timestamp node.
I also have tried the msg = { payload: ... config: { options: ... columns: ... } } format with the same result

var tabledata = [
{id:1, name:"Oli Bob"},
{id:2, name:"Mary May"},
{id:3, name:"Christine Lobowski"},
{id:4, name:"Brendon Philips"}
];

msg.config={
options:{ "movableColumns": true, "resizableColumns": true},
columns:[{"title":"id", "field":"id", "editor":"input"},{"title":"name", "field":"name", "editor":"input"}]
};
msg.payload=tabledata;
return msg;

Στιγμιότυπο οθόνης (32)

You can use ui_control to detect page load and repopulate your data.

I posted the message because I gave up. I have tried any possible combination with no results . Finally I added a delay node and it worked. Thanks you Steve-Mcl because you reordered my thoughts. If anyone has a better solution about data repopulation on etable, a post from him will be valuable.

the flow is,,

[{"id":"93d74cf2.5d026","type":"tab","label":"Etable","disabled":false,"info":""},{"id":"9d4fcc38.7e656","type":"ui_etable","z":"93d74cf2.5d026","payload":"{}","payloadType":"json","options":"{}","group":"43e9e1e5.df555","name":"","order":2,"width":"11","height":"6","columns":[],"outputs":1,"cts":false,"x":750,"y":260,"wires":[["c801fb67.ae2b5","6a2c86dd.8a89b8"]]},{"id":"80c9a237.d306f8","type":"inject","z":"93d74cf2.5d026","name":"","repeat":"","crontab":"","once":true,"onceDelay":0.1,"topic":"","payload":"{\"a\":\"wombat\",\"b\":\"NEW\"}","payloadType":"json","x":210,"y":180,"wires":[["399d7493.54f434"]]},{"id":"c801fb67.ae2b5","type":"debug","z":"93d74cf2.5d026","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","x":890,"y":180,"wires":[]},{"id":"6a2c86dd.8a89b8","type":"ui_text","z":"93d74cf2.5d026","group":"43e9e1e5.df555","order":2,"width":"8","height":"3","name":"","label":"text","format":"{{msg.payload}}","layout":"row-spread","x":910,"y":260,"wires":[]},{"id":"d7274064.a40ad","type":"function","z":"93d74cf2.5d026","name":"","func":"var tabledata =[ \n    {id:1, name:\"Oli Bob\", progress:12, gender:\"male\", rating:1, col:\"red\", dob:\"19/02/1984\", car:true},\n    {id:2, name:\"Mary May\", progress:1, gender:\"female\", rating:2, col:\"blue\", dob:\"14/05/1982\", car:true},\n    {id:3, name:\"Christine Lobowski\", progress:42, gender:\"female\", rating:0, col:\"green\", dob:\"22/05/1982\", car:true},\n    {id:4, name:\"Brendon Philips\", progress:100, gender:\"male\", rating:1, col:\"orange\", dob:\"01/08/1980\",car:true},\n    {id:5, name:\"Margret Marmajuke\", progress:16, gender:\"female\", rating:5, col:\"yellow\", dob:\"31/01/1999\",car:true},\n    {id:6, name:\"Frank Harbours\", progress:38, gender:\"male\", rating:4, col:\"red\", dob:\"12/05/1966\", car:true}\n];\n\nmsg={\n    payload:tabledata,//load row data from arraycar:true\n    config:{\n    options:{layout:\"fitColumns\",      //fit columns to width of table\n    autoResize:true,\n    //responsiveLayout:\"hide\",  //hide columns that dont fit on the table\n    tooltips:true,            //show tool tips on cells\n    addRowPos:\"top\",          //when adding a new row, add it to the top of the table\n    history:true,             //allow undo and redo actions on the table\n    pagination:\"local\",       //paginate the data\n    paginationSize:7,         //allow 7 rows per page of data\n    movableColumns:true,      //allow column order to be changed\n    resizableRows:true,       //allow row order to be changed\n    initialSort:[             //set the initial sort order of the data\n        {column:\"name\", dir:\"asc\"},\n    ]},\n    columns:[                 //define the table columns\n        {title:\"Name\", field:\"name\",width:10, editor:\"input\"},\n        {title:\"Task Progress\", field:\"progress\", hozAlign:\"left\", formatter:\"progress\", editor:true},\n        {title:\"Gender\", field:\"gender\", editor:\"select\", editorParams:{values:[\"male\", \"female\"]}},\n        {title:\"Rating\", field:\"rating\", formatter:\"star\", hozAlign:\"center\", editor:true},\n        {title:\"Color\", field:\"col\", editor:\"input\"},\n        {title:\"Date Of Birth\", field:\"dob\",sorter:\"date\", hozAlign:\"center\"},\n       {title:\"Driver\", field:\"car\", hozAlign:\"center\", sorter:\"boolean\", editor:true},\n       ]\n}};\nreturn msg","outputs":1,"noerr":0,"initialize":"","finalize":"","x":620,"y":260,"wires":[["9d4fcc38.7e656"]]},{"id":"be6dc14a.1cb8c8","type":"ui_ui_control","z":"93d74cf2.5d026","name":"","events":"all","x":300,"y":260,"wires":[["576a13b4.3ea63c"]]},{"id":"399d7493.54f434","type":"function","z":"93d74cf2.5d026","name":"","func":"msg.payload={\"tab\":\"TABLES\"}\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":160,"y":260,"wires":[["be6dc14a.1cb8c8"]]},{"id":"576a13b4.3ea63c","type":"delay","z":"93d74cf2.5d026","name":"","pauseType":"delay","timeout":"300","timeoutUnits":"milliseconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":470,"y":260,"wires":[["d7274064.a40ad"]]},{"id":"43e9e1e5.df555","type":"ui_group","name":"Group 1","tab":"1e9c26af.c3f349","order":1,"disp":true,"width":"11","collapse":false},{"id":"1e9c26af.c3f349","type":"ui_tab","name":"TABLES","icon":"dashboard","order":35,"disabled":false,"hidden":false}]

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.