Hi Skyline community,
I have a page in my App which contains a table component (Table 19). My page is opened from an URL containing a string feed with a specific DOM instance ID.
I would like to select by default the row from my table matching this ID.
I tried to use the "On page load" event from the page, and add an action "Execute component action" and "select an item" for my table (see screenshot attached).
But I did not find in doc how to choose the selected row. Can you help please?
Thanks
Kévin
Hi kevin,
This action is used to set the selection of the table based on the output of a previous actions. It cannot be used to set the default selection of the table (yet).
If you want to set a default selection using the URL, you will have to specify the data input in the URL itself. For your use case, this url will need some query row data. The format that has to be used is the following: VERSION\u001FCOLUMNS\u001ECELLS\u001EKEYS
- VERSION: a parameter with the data version, currently always v:1
- COLUMNS: a list of the column Id, Name & ClientType (number, string, guid, boolean or date) of the columns in order separated with \u000E. Each column is separated with \u001F. The ID of the column can only be found in the response of the OpenQuerySession call that is done on that page.
- CELLS: This part can be left empty for this use case.
- KEYS: a list of the keys of the rows, separated with \u001. Here the key will be the ID of the DOM instance.
Example with a single name column: {"query rows":["v:1\u001F42d739f3-89c0-4fc2-bbc2-56002abdc831_Name\u000EName\u000Estring\u001E\u001Ee2b31eaccd08407fa94f45316361066e"]}
Now you can use the constructed string to select the row in the table: ?data={"components":[{"cid":COMPONENT ID, "select": DATA STRING]}
- COMPONENT ID: the id of your component. This can be found by editing the app and looking at the name, eg: 'Table 1' => ID = 1
- DATA STRING: the string that was constructed above.
Note that the table will keep fetching rows until the row to select is found. It will not be scrolled into view.
This is not easy to get right, feel free to reach out again if you have any problems.