But I think I will never get that booking id until the script has loaded the data, so it will never work while executing, is there a way for me to have a conditional type executing like
I found a way, and I am sure there is a simpler way using the keys or indexes of the repeat, but for the moment I have added a blank variable, the click event populates the variable and loads the server action, while the spinner only shows if the record id is equal to the booking_id AND the server action is executing, like this
Thanks for updating this @psweb, seems like I’ve been posting on something close to the same thing only a few hours apart from you: having a spinner within only one row of a repeat/table.
As my use-case uses POST API, thanks to your post I was able to come up with an equivalent solution: use a hidden form external to the repeat-region/table with unset hidden inputs. On-click, the hidden input gets set from the row’s unique-like ID, submits the form, and on-success unsets the form’s own input again. The conditional on the row’s styling is whether or not that row’s unique key is equal to the form’s (volatile) hidden input.
Note however, no matter what I tried, I couldn’t get the button inline border spinner to work and used alternate styling on the button.