New Events For Forms

Would be nice to have a native OnClick event for forms so I can click a whole row in DataTables/Repeating Panels.

Also, a Hover event so I can highlight it.

I’m sure I can do all of this in custom JS, just be nice to keep it in Anvil.

3 Likes

Feature request acknowledged! However… There is actually a way to make anything clickable in Anvil: put it inside a Link. Links are containers that have a click event (set their text property to empty string).

This follows the pattern from HTML of putting things inside <a> tags. So, try putting your Form contents inside a Link and using its click event.

Data Grid rows can be made clickable by unchecking auto_display_data to False, dropping a Link in, then dropping a Data Row Panel inside that. You need to set a Data Binding from self.item to the item of the Data Row Panel.

Here’s one I’ve set up to display an alert when a row is clicked:

https://anvil.works/build#clone:AFE65JHFO5GNQXCU=TGEOQZHXVZIW2LBBB6RIZ37H

4 Likes

hmm…

problem I have is that even with auto_display_data set to false, I still have the invisible columns, so any attempt to drop a link to fill the entire form fails (it just chooses one of the old column slots).

Still investigating …

edit - actually, I just drop the link “underneath” those blank column placeholders. The IDE can be a little fiddly when trying to select a “bottom” drop zone, if you see what I mean.

Works now.

1 Like

A post was split to a new topic: Make first row clickable