Master/Details table update and selected row reset

I’m currently testing what’s possible with appsmith and have created a simple master/details view, i.e. a table as master and a form as detail. What is the recommended approach to refresh the table after an update from the form?

The only solution I see so far is to run the get query for the master table after the update query in the click handler of the submit button on the form - but this completely resets the table and apparently setting selectedRowIndex on the previously selected row does not work.

Obviously, I want to “keep” the table with the row selected.

Hey, sorry for the inconvenience. I’ll create a bug and share for this.

In the meantime, you can store the id or index in appsmith store and update the default selected row to reference the index you store.

Ok, that works, but creates a new problem (kind of). Apart from the master table and the detail, I have a secondary table which is associated to the master table by a foreign key.

i.e. the query for the secondary table uses an id in the where clause based on the selected row in the master table.

So now the master table loads with the default selected row set, but this doesn’t properly trigger the query for the secondary table anymore… well, most of the times…

So here’s the sometimes repro (initial state: the store value was set to row 2, clicked row 1)

First reload is ok, 2nd reload doesn’t load the secondary table:


I guess this is some timing issue, can I influence that somehow?