I have a ui-table, I send any empty array to it via payload, content is cleared, so far so good. I then update the array that will populate the table, say item 9 in the array that will row 9 in the table. I check the array, values changed are in fact changed in the array, I send the array (which just happens to have only one item, but at offset 9, to the table, the ui-table updates, and 1 row presented, that happens to be item 9 in the array, ok so far so good.
Here is the question, if I then update item 9, again, in the array and then send the array to the ui-table via payload, the single row in the table does not update as it did before? I have to clear the entire table to update the given row? This seems odd.
If I add more rows, populate more of the array, set more elements in the array, the behavior is still the same, only after I wipe out the table completely, does the table seem to update consistently. Is this the expected behavior?
Yes, but the data is stale. I changed the flow design, so that I am updating the table content in full with each refresh of the table, this works fine and given the small table, completely acceptable. I just was wondering if the design of the ui-table was such that it does not handle individual row updates. I saw in github that the (row) Add/Update logic has an issue? Was wondering if I might be tripping over the same issue?
I also noticed that clearing the table, before payload send, or even disabling and re-enabling it, triggers a refresh. So I disable the table (msg.enabled false) send the payload (with any incremental changes included) and then send msg.enabled true, and the table refreshes.
This works well with the over flow design, such that I know on a long process to collect data to update the table, the grayed or disabled table communicates an update is pending.
Interesting, possibly has the advantage of making the logic of your flow simpler, right ?
I see that the question of table refresh is recurrent (for example here). This issue was discussed in this forum in the past. I remember that we found two different ways to get round the problem. This is the link to the discussion.
It is not clear in my mind why the table does not auto-refresh when it is updated. This would be the expected behaviour in my opinion. It may be related to the architecture of the underline Tabulator library (and its complex virtual DOM) or perhaps something specific about the ui_node working in Node-RED dashboard.
Do you have a simplified flow that reproduces the issue you are facing ? I could try to make a couple of tests to see if the workarounds found in the past may help you.
Let me try to create a transportable version of the flow... the current flow is quite complex. What I have now works... but I too would like to know what the deal is.