Right way to use turbo and stimulus event click inside table

I have a table, i need to click in a row using turbo event click and open(display) and close show action below the row

Tables (and tbodies) can only accept a TR as a direct child. This has two side-effects for using Turbo. First, you cannot put a turbo-frame inside a table, except as a direct child of a TD. Second, you cannot render anything that is not a “legal” child of a TD inside there. This means you can’t use Turbo all by itself to change the TRs inside a TABLE or TBODY container. You can use Stimulus to do that, just as you could use UJS “back in the day”.

Walter

1 Like