Repeater from data query
Mon Dec 13 2021 10:58:19 GMT+0000 (Coordinated Universal Time)
Saved by
@rumpski
function queryHawke(){
$w('#repeaterHawke').data=[]
console.log('about to query Hawke wheels')
$w.onReady(function () {
$w("#repeaterHawke").onItemReady(($item, itemData, index) => {
// const clickedImage = $item("#imageHinge")
$item("#imageHawke").src = itemData.imageLink;
$item("#nameHawke").text = itemData.name;
// $item("#imageHinge").onClick( (event) => {wixLocation.to(itemData.productUrl)} );
//$item('#viewHinge').onClick(() => {wixWindow.openLightbox('image', itemData)});
});
wixData.query("wheelSpec")
.eq("brand", "Hawke wheels")
.eq("nameFeat", true)
.ascending("name")
.find()
.then((results) => {
console.log('query result done with hawke')
if (results.totalCount > 0) {
$w("#repeaterHawke").data = results.items;
}
})
.catch((error) => {
console.log("Error:", error.message);
});
});
}
content_copyCOPY
Comments