I have read an tried various suggestions here but can’t get this to work. It’s probably something simple so I apologise for being an idiot but hope someone can help.
Thanks
Warren
I have a collection of properties which are being displayed in a repeater.
As expected. Some properties do not have certain pieces of data, an example would be, no Facebook page.
I have created a draft here: https://mih-websites.wixsite.com/my-site-2
I like the way the button is displayed in grey if no data and coloured if there is a link.
The problem I am having is when you move the mouse over the button which recognises there is a link, it wont let you click and open the link.
Here is all the code on the page:
import wixData from ‘wix-data’ ;
$w . onReady ( function () {
let myData = $w ( “#dataset1” ). getCurrentItem (). facebook ; console . log ( myData )
if ( myData === ‘Yes’ ) { $w ( ‘#button1’ ). enable ();}
else { $w ( ‘#button1’ ). disable (); } //TODO: write your page related code here…
}) ;
/**
- Adds an event handler that runs when the cursor is inside the
input element and a key is pressed.
Read more - @param {$w.KeyboardEvent} event
*/
export function searchBar_keyPress ( event ) {
let searchValue = $w ( “#searchBar” ). value ;
$w ( ‘#dataset1’ ). setFilter ( wixData . filter (). contains ( ‘title’ , searchValue ). or ( wixData . filter (). contains ( ‘island’ , searchValue ). or ( wixData . filter (). contains ( ‘atoll’ , searchValue ))))
}