This is code which came from the CodeQueen. This is the second page “results” of a multiple search. Shelter4 is my database and sName and sNumber are two fields within. The repeater is named shelterList. The repeater shows up with all records but does not filter out what was in the #searchBar. I get an error message of the line:
$w(‘#shelterList’).data = res.items; Where data has a red underline and the message is “‘data’ doesn’t exist on ‘shelterList’”.
Any thoughts what I might have missed?
Thanks,
Jeff
import {local} from ‘wix-storage’;
import wixData from ‘wix-data’;
$w.onReady( function () { var sameWord = local.getItem(“searchWord”);
$w(“#searchBar”).value = sameWord;
$w(“#searchBar”).placeholder = sameWord;
$w(‘#dataset1’).onReady( function () {
search();
});
});
export function searchButton_click(event) {
search();
}
Check that your dataset id is actually ‘#dataset1’ in the properties panel or by hovering over the element itself as on Nayeli’s example her dataset is called ‘Name’, however for the code she has to use the id name which is ‘#nameDataset’.
Hi,
Thanks for the quick reply and the thorughness of your answers. However, I’ve checked the dataset name, the database name, the field keys and I’ve watched the video 4 times. I see hers works, but mine doesn’t. Any more clues?
Is #shelterList a Repeater ? Your error message “‘data’ doesn’t exist on ‘shelterList’” seems to indicate that it is not a Repeater . Repeaters have a .data property which is used to set the contents of the Repeater.
If you continue to experience problems, please post the editor URL of your site. Only authorized Wix personnel can get access to your site in the editor.Please include the name of the page involved.
@yisrael-wix Yes, shelterList is the name of the repeater. It displays with all of the records but is not filtered as described in the video. The URL is https://jeffhanner10.wixsite.com/rcshelters. There are two pages in test which you can only access through the editor. The first is “test page search” and the second is “results”. the search starts in page 1 and ends up in results. As you will see this is for the Red Cross. I am a volunteer and not paid for this effort. Any help is appreciated.
You have the shelterList Table connected to a dataset , so you should not be doing a query and then setting the contents of the Table . You should do a dataset filter and the Table will be updated according to the filter results.
Can I use CodeQueen’s tutorial for grid gallery instead a repeater as she has used? If so, I tried and I run with a problem at the end line, where for me it is $w(’ #ProductSearchResults ').data = res.items;. Under “.data”, is dotted lines that says "data does not exist on “ProductSearchResults”. Could you please help me here? Thank you.
As Yisrael has already stated above in a previous reply about the user using a table instead of a repeater… Repeaters have a.dataproperty which is used to set the contents of the Repeater.
If you want to use a grid gallery then the #ProductSearchResults element, which I can assume is your gallery, then you will not be using a data property, so you would need to change it to suit your gallery, which would be items.
Also, instead of asking on here, why not just reach out to @code-queen yourself and ask her through her own website or YouTube channel from where you are looking at either her tutorial or video about it.