How to add a button inside a wix user element table

I need to add a button in each and every column or raw if possible, the button should be able to delete the raw and many more, but first help me on how i can possibly add a button in a table raw or column

Hi,
Buttons can’t be added to a Table. You can use a Repeater instead. The repeater item (row) can have a button, and onClick you can delete that row using your $w selector. For more information, please see Repeater - Velo API Reference - Wix.com.

While button cannot be added to the table, there is a workaround.

I added a calculated column to the table using an afterquery data hook and set a static text “View” to it.

export function Properties_afterQuery(item, context) {
let hookContext = context; // see below
item.viewProperty = “View” ;
return item;
}

Then, I gave that calculated column a proper name from the sandbox view.

And then I added the field to the table element and set the link to the dynamic page link. It appeared neatly on my table.

Through this method, I could also add an Edit link to the table which is what I wanted, two different links on my table that my users can distinctly identify.

Hope this helps!

Hi Anant Acharya .
Am trying to implement the same but I cant seem to get it working. I have a table called Bought Shares and I want it to have a button in one of its columns. Kindly assist me with any info on how to go about it. I tried the code below but its not working…

export function BoughtShares_afterQuery(item, context) {
let hookContext = context; // see below
item.action = “Details” ;
return item;
}

Hi, Anant

This is very nice of you to post this. I would like you to elaborate more on this. As I wanna know where to put link for ‘view’ and how to connect it properly. As your images showing something but I am not able to understand the full scenario. Kindly help again : )