Hi! I am working on a website where you can create a profile and add specializations, sport, as well as a location (City, State) to your profile. All of that information goes into a dataset. The specializations are Tags in the database, and the location is in Field Type: Address in the database.
On the search profile page, I have two dropdown boxes and one search by location Address Input Box. Along with a Search Button, Reset Search Button, and a Repeater Box The Repeater has all of the individual profiles loaded in there with the persons Name, Profile Picture, Location, Area of specialization and, Sport Specialization.
When I attempt to connect the data to filter the repeater, there is nothing that occurs. Does anyone have any similar situations with attempting to search for "Tags" as well as "Address"? or Coding Ideas?
I get 2 errors on my code, which I have highlighted. The first error is 'Expected 1 Arguments, But got 2'. And the 2nd error I got was 'Identifier Expected'. Here is my current code below:
import wixData from 'wix-data';
$w('#resetButton')
$w.onReady(function () {
});
export function searchButton_click(event) {
search;
}
function search() {
wixData.query("Items1")
.contains("areasOfSpecialization", String($w('#areaOfSpecializationDropdown').value))
.and(wixData.query("Items1").contains("sportSpecificSpecialization", String($w('#sportCoachSpecializationDropdown').value)))
.and(wixData.query("Items1").contains("locationCityState", $w('#addressInput2').value.toString())
.find()
.then(results => {
$w('#repeater2').data = results.items;
})
$w('#resetButton').show();
$w('#resetButton').enable();
$w('#searchButton').hide()
}
export function resetButton_click(event) {
$w('#dataset1').setFilter(wixData.filter());
$w('#areaOfSpecializationDropdown').value = undefined;
$w('#sportCoachSpecializationDropdown').value = undefined;
$w('#addressInput2'). = undefined;
$w('#searchButton').show();
$w('#searchButton').enable();
$w('#resetButton').hide();
}
There are now no errors in the coding. I was missing a set of () on the last string, and added ,value to take away the error code with the '='.
The problem I am running into now is the page loads with the repeater and all of the profiles. It does not allow me to narrow it down based upon location, area of specialization or sport coach specialization. I enter the location, and select form my two dropdown elements and hit search, and all of the profiles remain.
Does anyone have an idea for this? Or is this not enough information for you?
Thank you!