Row Action is triggering before Row Selection happens

  • Goal: To use Row Actions to run an SQL Stored Procedure against the selected row

  • Steps: I added a row action that triggers a query that runs a stored procedure and references the selectedRowKey

  • Details: This is the first time this has happened the only difference is that I have expanding rows on the table I want to run this action from.

  • Screenshots:


    In this image, I selected the row action for the 2nd row (blue highlight has moved), but the notification and the action are still stuck on the 3rd row.

Hi @Shegs,

Thanks for reaching out! I haven't been able to reproduce this bug :thinking: Are you still seeing this issue? If so, could you DM me the app json or post screenshots of the row event handlers?

Yep,
same issue: notice the job number matches the one in orange, yet I clicked the row action for the one highlighted blue.

Here is the screenshot of that row action handler:

it calls a query that runs a stored procedure, but I use the confirmation message to make sure it's running on the correct one:

I tried recreating this issue on a new app using the Demo Data in a table that also expands and it seems to select the row first then trigger the action as it should. so I am not sure why.

I did create a JS Query that delays the row action by 300ms and that seems to work as a wait for the selection to change.

Hi @Shegs

Thanks for the screenshots! Glad you have a workaround :slightly_smiling_face:

It's interesting that it works in a new table :thinking: The same set up is also working on my side

Is this happening on stable 3.148?

If you can also share the app json, I can report it internally for a fix

3.148.3
I'll send you the JSON

Thank you! The export was very helpful. It looks related to the double click event on the table. If I remove the double click event, it starts working as expected (without the delay)

interesting.

I will keep you posted on a fix for this bug!

is there any update for this bug? the double click functionality is very useful but worthless if I can’t use the row actions.

Hi @Shegs ! Thanks for your patience - I just bumped the internal bug report since there are no updates yet :frowning: . I'll be sure to post here as soon as I hear back.

In the meantime, could you try out the additionalScope option? This docs link has more info about this option and also contains a visual example of how it is being used in an app. You can also check out this Community post about using additionalScope in your queries.

Once you have added the additional scope to the query, you will have to adjust your query to reference the value.

Then, reference the additional scope in the Row actions > Event handlers > Edit click action handler settings for your table. By triggering the query with additional scope, you can pass in currentRow instead of using tableName.selectedRow.

Let me know if you have any questions about this!

-Jen

Hi @Shegs ! Checking back in to see if you were able to try out the additionalScope suggestion :slight_smile:

-Jen

ha! I was looking at this today as I develop a new app. I haven’t had the chance to test it on an existing app that has had the error in the past, but I think this should work to hold me over until it’s fixed.

Thanks

@Shegs No problem at all :slight_smile: . I'll update you once there is some activity on the internal bug report. Let us know if you have any questions in the future!

-Jen