Does anyone know how to add code to make an email address clickable in a (dataset) table cell? I cannot find any documentation on how to do this. Any help is greatly appreciated!
To do it on it’s own you can simply add it to your page.
https://support.wix.com/en/article/creating-a-clickable-email-address
If you use the Wix Table Master app on your page, then you can simply do it without the use of code.
https://support.wix.com/en/article/adding-a-link-in-the-table-master-app
To do it with code see this previous forum post below, you can use the URL field or even the Rich Text field as the Rich Text will help you to show your HTML content as you want.
https://www.wix.com/corvid/forum/community-discussion/hyperlink-inside-database-table
You should also have a read of these links to the Wix API reference for cell and row select in a table.
https://www.wix.com/corvid/reference/$w.TableCellEvent.html
https://www.wix.com/corvid/reference/$w.TableRowEvent.html
Then you could do something like this.
- add a user input and a table that is connected to your collection
- add the sort you want to the data set by clicking on manage dataset option or using code
- add an event on the user input element (example: on key change event)
- in that event get the value inputted and add a filter to the table’s data set based on this value
- for the table add on row click event
- on the click event get the row data
- get the value of the field that connects to the dynamic page
- use wixLocation.to () to link to this dynamic page
Thanks GOS. I have the code in place that is needed however, I don’t know what I need to insert into this piece of code (at the "mailto:…) to retrieve and open/send an email when the cell is clicked. I also have the data column set as Rich Text. Here is what I have:
import wixData from 'wix-data';
// For full API documentation, including code examples, visit http://wix.to/94BuAAs//
$w.onReady(function () {
//TODO: write your page related code here...
});
export function filterInput_keyPress(event, sw) {
let SearchValue = $w("#filterInput").value;
$w("#dataset3").setFilter(wixData.filter().contains('name', SearchValue)
.or(wixData.filter().contains('cityStateZip', SearchValue))
.or(wixData.filter().contains('cards', SearchValue)));
}
setTimeout(() => {
let val = $w('#filterInput').value;
console.log(val);
}, 10);
export function table1_cellSelect(event) {
$w("#dataset3").setFilter(wixData.filter().contains('email', SearchValue)
$w('#email').link = 'mailto:' + itemData.email;
}
Hi Norwood,
Did you ever find guidance on this?