Run a JS query when clicking aa `<a>` link in table HTML or HTML Component

I have a table that uses HTML columns extensively. I have buttons to open modals to edit the underlying data. They do take up quite a bit of real estate however. What I would be really slick is to do is have <a> links that open the modals. This would also duplicate the functionality the users are used to with the old web site Retool is replacing.

Link 1 in red opens a a different app in into a new tab which replaces the View Project button. That works just fine now.

Link 2 would hopefully open a modal which edits the Job. Right now I have the Edit Job button.

Link 3 would open the individual task in a modal, but I have to use the Edit/Add tasks button right now. That column is showing multiple sub records.

So what I am asking for is a way to call a query from an <a> tag. Would also be useful for inline links in HTML components.

I realize that I could get the effect I am looking for if I re-did this table to use a ListView component and used the Link component. But I would need to nest the ListViews to get the sub records (which actually works) but there are significant performance issues with that method right now.

Hey @bradlymathews!

At the moment, the team is still working on adding more robust handlers to link and button columns and it may be a bit until this level of granularity is reached but we can report back here when there's an update or if there are other changes that make this more feasible.

In the meantime, have you tried setting the hash parameters of your app using your links and then listening for changes in those parameters with, for instance, a Query JSON with SQL query? You can then use the event handlers on that query to trigger various actions:

3 Likes

@Kabirdas, Dude that is absolutely genius!

That does exactly what I need, this feature request no longer needed so I guess I should move this into the Tips and Tricks.