-
Goal: Default row selection of the table based on REST API query data.
-
Steps: Add a table component to the page and choose some REST API query for its data source. Make sure that the primary key is defined. In table properties choose Default Row: Key. Select "Default Key": 2 (assuming table source data contains id equals 2)
-
Details: You can see that the table row with id 2 was selected but after reloading the page, the default row selection is not applied to the row with id 2. I also tried to add action "on success" of REST API query to select table row with id 2 without success (same behavior as previously). Only after applying a "Debounce" delay of 100ms, it starts to work as expected: after the page reloads - a row with id 2 was selected after a 100ms delay from the success event of the REST API query.
-
Screenshots:
-
App JSON export:
TestTableEdit.json (28.8 KB)
1 Like
Hello @Denis_MLoan ,
You don't need to add a primary key to the table. Also, please remove the " on success" handler from the REST API
*** Refer to the screenshot for clarification.**
Thank You.
4 Likes
Hi @Denis_MLoan Thanks for sharing your workaround! This sounds similar to an issue that Paulo details here, but I see that you do have a Primary key set in the sample app json: 'Default Row' property does not work in table component - #9 by Paulo
I see that our team is investigating race conditions where the default row selection isn't being set properly. Ideally, you should only have to set it on the table config. I will add your example. I'll follow up here if I get any updates internally