DATABASE TABLE

HELP! 2 Part question. I’m so new to this… I have zero coding ability. But managed to create a table using a database in the developer tool so there’s hope. I see that I can sort/filter the table but that’s on the my end, the backend. How can I set it up so that each column in the table can be filtered or sorted on the customer’s/viewer’s end?

Secondly, I added a column that needs to be linked to a pdf. I named the column datasheet and attached the pdf in database. But it wont let me select the “datasheet” column? Why?
I see it but it’s grayed out. In the interum I selected a different option ID text option and linked that to the document but now it displays the file name. How can I get it to just show the PDF icon?

It needs to look like this


this is what i have now…

Hello Alicia,

First Part:
You add filters on the data set connected to the table:

  • click on the dataset → settings → filter


note that you can add more than one filter.

Second Part:
what i understand is that you want a PDF icon to show that links to the datasheet link.
based on that i will suggest the following:

  • in your database add two field, one contains the pdf icon and the other the link that it should direct to.

  • manage the table to show the pdf icon field and not the link field.

  • go to table’s settings and on the Clicking selects choose cells .

  • then on Tools → select developers tools

  • click on the table to see the properties → add onCellSelect event

  • Now add the following event code to open the link of each:

export function table1_cellSelect(event, $w) {
 //Add your code for this event here: 
 let url = event.target.rows[event.cellRowIndex].link;
 wixLocation.to(url);        
}

this way when you click on the cell (icon) it will send you to the right link.

I hope it goes well !
Massa

Thank you Massa!!!