Creating Clickable grid

Psychopy (v2024.1.4)
I’m looking to develop an interactive grid where participants can click on the cells to toggle them on and off, with their selections being saved. Below is an example of such grid. Additionally, I found a similar entry for such a feature (response to this thread) (How to present all the squares at the same time using the custom code? - #13 by mayling) , but unfortunately, there were issues with python as well as js version. Any assistance in resolving this would be greatly appreciated.