top of page

Forum Posts

Alexander Weidinger
Aug 16, 2018
In Coding with Velo
Hi Developers! Currently I have this problem where i need to create a search bar on my site, which allows the users to search on both title and description and maybe one more parameter. I have this code which works on only 1 parameter, in this case the title (properties "title") but not on the description (properties "beskrivelse") import wixData from "wix-data"; let lastFilterTitle; let lastFilterBeskrivelse; let debounceTimer; export function iTitle_keyPress(event, $w) { if (debounceTimer) { clearTimeout(debounceTimer); debounceTimer = undefined; } debounceTimer = setTimeout(() => { filter($w('#iTitle').value, lastFilterBeskrivelse); }, 500); } function filter(title, beskrivelse) { if (lastFilterTitle !== title || lastFilterBeskrivelse !== beskrivelse) { let newFilter = wixData.filter(); if (title) newFilter = newFilter.contains('title', title); if (beskrivelse) newFilter = newFilter.contains('beskrivelse', beskrivelse); $w('#dataset1').setFilter(newFilter); lastFilterTitle = title; lastFilterBeskrivelse = beskrivelse; } } I would like it to work as following: 1. A user types "tomatsuppe" and finds the recipie for "tomatsuppe" because it is the title 2 A user types "tomater" and find the same recipie, because "tomater" is a word from the description I hope that you can help me out here! :) My site is https://alexanderweidinger.wixsite.com/test
0
1
244
Alexander Weidinger
May 16, 2018
In Coding with Velo
Hi Guys! First of all thanks for your support. I have a repeater implementet on my site and a search bar linked to it created from userinput and then some coding. I am then wondering if its possible to make a loading text or image when you as user is using the search/(søg) bar: i have this coding at the moment and it works great, but there are still some loadtime, which should be shown as an preloader. import wixData from "wix-data"; let debounceTimer; export function iTitle_keyPress(event, $w) { if(debounceTimer) { clearTimeout(debounceTimer); debounceTimer = undefined; } debounceTimer = setTimeout(() => { filter($w('#iTitle').value); }, 200); } let lastFilterTitle; function filter(title) { if (lastFilterTitle !== title) { $w('#dataset1').setFilter(wixData.filter().contains('title', title)); lastFilterTitle = title; } } So is it possible to do a preloader on the repeater when searching? i tried this function, with the "onchange" export function also, instead of the "onClick" $w.onReady(() => { waitForLoading(); }); export function button6_onClick(event) { $w('#preloader').show(); waitForLoading(); } function waitForLoading() { setTimeout(() => { $w('#preloader').hide('FadeOut'); }, 1500); } Hope you guys can help me!
Preloaders and Repeaters content media
0
1
457
Alexander Weidinger
Apr 13, 2018
In Coding with Velo
Hi Guys. I have a repeater linked to a dataset and the dataset linked to a database. In the repeater i have 2 buttons - one for links and one for files. When you enter a link in a post it will make it "true" in my boolean data column "knapURL". When you enter a file it will make it true in boolean column "knapPDF". And ofcourse they will be false if not entered. I then want to hide the button "#button1" which is linked to "knapPDF" when it is false and vice versa. Ive tried this solution, but sadly it dosn't work :( I hope you guys can help me! Thanks alot.
Hide button boolean wix database content media
1
15
1k

Alexander Weidinger

More actions
bottom of page