# UI-Table sort on load

**URL:** <https://discourse.nodered.org/t/ui-table-sort-on-load/25665>\
**Category:** Dashboard\
**Created:** [28 April 2020 07:54 UTC](https://discourse.nodered.org/t/ui-table-sort-on-load/25665 "2020-04-28T07:54:15Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![Christian-Me](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/christian-me/32/10774_2.png) [@Christian-Me](https://discourse.nodered.org/u/Christian-Me)\
**Post date:** [28 April 2020 20:09 UTC](https://discourse.nodered.org/t/ui-table-sort-on-load/25665/3 "2020-04-28T20:09:42Z")

</div>

Hi, sure I try to help

> [@bdbell](#):
>
> I am using the UI-Table 'Sending Commands' example

Sorry to say but it is not of the best examples for practical use. It is more a demo and not good designed as it only records table entries when the table is visible on the dashboard.  
For handling all kinds of table related stuff look at the "ui-table handler" included in this example.

> [@A Syslog Server for the Dashboard](https://discourse.nodered.org/t/a-syslog-server-for-the-dashboard/24337):
>
> Hi perhaps somebody is interested. Just finished a syslog server for the node-red dashboard. It makes use of ui-table. I hope somebody finds it useful. It is build around ui-table and a subflow I use for all kinds of tables in my projects. [https://raw.githubusercontent.com/Christian-Me/node-red-contrib-home/master/Node-RED/syslog/screenshots/demo.gif(image larger than 4096KB)](https://raw.githubusercontent.com/Christian-Me/node-red-contrib-home/master/Node-RED/syslog/screenshots/demo.gif) Features can handle quite huge amounts of data only limited by the clients browser. As every line is sent individual…

Here the context storage is placed before the table so it records entries when they arrive regardless if the table is visible or not and replays everything when the tab gets visible by ui\_conrol.

> [@bdbell](#):
>
> But when it reloads the table data from context store I find that the entries are are in the opposite order than I have entered them

I don`t know how the effect happens (are you using the add on top feature?) but perhaps experiment with **Sort Order** section here ([Tabulator | JavaScript Tables & Data Grids](http://tabulator.info/docs/4.4/sort)) . Be carefull to read the docs for version 4.4! This is the version included in ui-table.

> [@bdbell](#):
>
> but when I do that all the data in the table disappears so I am still not doing it correctly.

That should not happen. Please make sure that the message including `msg.ui_control` has either no `msg.payload`or valid data (perhaps use a change or function node with `delete msg.payload`). Sending ui\_control should change the layout but not the data if no payload is send (but perhaps I have to do some tests)

---

_[View the full topic](https://discourse.nodered.org/t/ui-table-sort-on-load/25665)._
