After Applying filter all results erased from repeater

Hi all ,

recently , I tried to open new page for learning Wix code.
at this page I trying to work with Collection that already uploaded to the Database.

I create Dataset on
Collection(all) {the gallery of all products)
Collection(Title) {the product page)

its works OK , but when I tried to filter my collection using Code below:

import wixData from 'wix-data';

    $w.onReady(function () {

    $w("#button6").onClick(()=>{

        $w("#dynamicDataset").setFilter(wixData.filter()

            .eq("title", $w("#dropdown1").value));
            }); 
 
            });

I tried to filter “men” from column “Title” (as I understood reference must be in lowercase)
Should I insert filter option to dynamicDataset (with “men” value)?
dropdown1 contain labal “Men’s” with related value of “men”

all my data was erased and It can’t shown again , only if I going to editor again.
and I synced Sandbox to live

I can’t find the issue that block me to see the filtered results on repeater

Please Help !

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.

1 Like

ExpressJeans

https://sniroded05.wixsite.com/mysite

Please update

Thanks in advance.

@sniroded05 I see all of your data in the Live database. You don’t have any code that could do anything. Code cannot remove a collection.

The two JeansX pages are not connected to a collection. When I run in Preview, I get the error message that the JeansX collection has been removed. To restore its data, you can create a new collection with the same name, and the previous collection of that name will be restored. Once your recreate your JeansX collection, the JeansX dynamic pages will once again be connected and should work.

Please try to preform your steps on Jeans_Example
The another dynamic pages should be erased.

But when I tried to erase Wix freeze and only refresh fix it (without deleting the JeansX pages)

So ignore it , and try to preform it on Jeans_Example

Thanks in advance.

What steps? There’s no code and nothing to do but Preview the page.
What isn’t working for you?

I’m not quite sure what your problem is, but if you’re trying to do “All”, you need to clear the filter. If you’ve selected something other than “all”, then you apply the filter. You need something like this:

$w("#button6").onClick(() => {
  let val = $w("#dropdown1").value;
  if(val === "all") {
     $w("#dynamicDataset").setFilter(wixData.filter());
  }
  else {
     $w("#dynamicDataset").setFilter(wixData.filter()
       .eq("title", val));
  }
});