I am trying to create a page in which Home page shows the City names and all City names(Buttons) are linked to Dynamic page using Dyanimic page of my database with field(PSData/City).
In the Dynamic Page I used a repeater to display the data of selected city. This repeater displays data from each row of Database/collection (consists item name, item Image, Area location & City). Here now I would like to use a search bar to further filter the data to selected/searched Area .
But when I am using Searchbar with wix code, the result of search is coming fine if we search the areas of selected City. But strangely it is also showing the results of other cities which are matching with the search.
I am giving the screen shots below.
My purpose is in the Home page City should be clicked then the repeater should show only results pertaining to City and a Search bar in the next page to further filter the data(but it should limits to the selected City only).
My Code is
import wixData from ‘wix-data’;
$w.onReady( function () {
var citytext = $w(“#text31”).text
});
export function search1_keyPress(event) {
$w(“#dynamicDataset”).setFilter( wixData.filter()
.contains(“city”, citytext))
.and
.contains(“area”, $w(‘#search1’).value) ;
// .and (wixData.filter()
// .contains(“city”, $w(‘#text31’).value) // For Not Chainging the Dynamic Value of City //
// );
}
Please Help.
My Home Page
Next Page is City Page on Clicking the City Button
The above code i tried but could not through. Please Help in resolving my issue.