Click event in a table cell

I am trying to get some code to work in the Click event of a table cell.

The code is AddPatient3. Its purpose is to put the text "Booked" into the cell.

When I run the code in development mode, it works fine.

I have tried putting the code into into the Click Cell event handler as a "Control Query" or as "Run Script". Neither option works.

Any suggestions?

Mike

1 Like

Hi @mdsmith1 :waving_hand:

This happens because Retool doesn’t trigger cell click events on non-editable columns. That’s why your AddPatient3 query works in development but not when clicking the table cell.

:white_check_mark: Fix

  • Make the column editable, or
  • Use a Button column (recommended) and trigger AddPatient3 from its click event

:magnifying_glass_tilted_left: Quick check

Add a simple log in the event:

console.log("clicked");

If nothing logs, the click event isn’t firing.

You can refer to the sample setup image below

Feel free to reach out if you have any confusion or further questions.