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

**URL:** <https://discourse.nodered.org/t/etable-is-empty-on-browser-refresh-node-red-contrib-ui-etable/39050>\
**Category:** Dashboard\
**Created:** [13 January 2021 11:34 UTC](https://discourse.nodered.org/t/etable-is-empty-on-browser-refresh-node-red-contrib-ui-etable/39050 "2021-01-13T11:34:41Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![yiannis](https://avatars.discourse-cdn.com/v4/letter/y/e47774/32.png) [@yiannis](https://discourse.nodered.org/u/yiannis)\
**Post date:** [13 January 2021 11:34 UTC](https://discourse.nodered.org/t/etable-is-empty-on-browser-refresh-node-red-contrib-ui-etable/39050/1 "2021-01-13T11:34:41Z")

</div>

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)](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/6/4/647b668a17a178181ad5f86cee972cfa96de8c77.png)

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [13 January 2021 23:01 UTC](https://discourse.nodered.org/t/etable-is-empty-on-browser-refresh-node-red-contrib-ui-etable/39050/2 "2021-01-13T23:01:20Z")

</div>

You can use ui\_control to detect page load and repopulate your data.

---

<div class="post-metadata">

**Author:** ![yiannis](https://avatars.discourse-cdn.com/v4/letter/y/e47774/32.png) [@yiannis](https://discourse.nodered.org/u/yiannis)\
**Post date:** [14 January 2021 12:51 UTC](https://discourse.nodered.org/t/etable-is-empty-on-browser-refresh-node-red-contrib-ui-etable/39050/3 "2021-01-14T12:51:29Z")

</div>

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.

 ![Στιγμιότυπο οθόνης (34)](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/1/a/1a24285131c89e65fa45a40b32d9bf64dcfb2150.png)

the flow is,,

```auto
[{"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}]

```

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [13 February 2021 12:51 UTC](https://discourse.nodered.org/t/etable-is-empty-on-browser-refresh-node-red-contrib-ui-etable/39050/4 "2021-02-13T12:51:48Z")

</div>

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