WiX Data Filters

Поделиться
HTML-код
  • Опубликовано: 2 ноя 2024

Комментарии • 109

  • @nguyenanhtu4799
    @nguyenanhtu4799 5 лет назад +82

    the smart thing to do would be to give us the code in the comment or something ...

  • @melsemail1641
    @melsemail1641 5 лет назад +14

    This is the code,note that in the video the numbers field in the database are actually text,cause dropdown won't take numbers so in order to use numbers you need to add a code that makes numbers a string,this is the code that works for me with the first two options
    import {wixData} from 'wix-data';
    $w.onReady(function () {
    //TODO: write your page related code here...
    });
    export function button1_click(event, $w) {
    $w("#dataset1").setFilter(wixData.filter()
    .contains("bathrooms", $w('#dropdown1').value)
    .contains("bedrooms", $w('#dropdown2').value))
    .then((results) => {
    console.log("Dataset is now Filtered");
    $w("#repeater1").data = results.items;
    })
    .catch((err) => {
    console.log(err);
    });
    $w("#repeater1").expand();
    }

    • @melsemail1641
      @melsemail1641 5 лет назад +1

      and the values in the dropdown has to be exactly the same as in the database

    • @milehighhealthandwellness6945
      @milehighhealthandwellness6945 4 года назад

      This worked for me. Thanks. The only problem now is that when I select an option in the Dropdown.. all the other options disappear and the only option to click is the current option that I’m viewing. How do you suggest that Overcome this problem?

    • @ZonHed
      @ZonHed 4 года назад

      hallo,
      i have a question , I didn't study programming and i need a code for the check box. when i click on the checkbox the gallery shows a photo but me and my friend tried to do everything to make it happen but it didn't work i don't know if it is from the database/ collection or from the code. if you can contact with me :
      Discord : Reksem king#4394
      Gmail : reksem.king@gmail.com

  • @ireneang6397
    @ireneang6397 5 лет назад +3

    Thank you so much. Finally managed to solve my problem of filtering multiple selection. Really appreciate it.

  • @frankkawina5332
    @frankkawina5332 5 лет назад +8

    i used conditional filtering code for my drop-downs but i cant seem to get the search button to respond

  • @brendadavisson740
    @brendadavisson740 4 года назад +3

    Can you explain more on the "search" button added to this page. How it that configured?

  • @parulghosh1
    @parulghosh1 4 года назад +8

    I'm so lost! I just want one category drop down and link it to the dataset. Just can't figure out the code. Someone help?

    • @madalinanyc1
      @madalinanyc1 4 года назад +2

      import {wixData} from 'wix-data';
      export function search_click(event,$w) {
      //this filters the dataset using one filter which pulls from productType column in my DB table
      $w("#dataset1").setFilter(wixData.filter()
      .contains("productType",$w('#dropdown1').value))
      .then((results) => {
      console.log("dataset is now filtered!");
      $w("#repeater1").data=results.item;
      }).catch((err) => {
      console.log(err);
      });
      $w("#repeater1").expand();
      }

    • @Fannylambotte
      @Fannylambotte 3 года назад

      Did you find a way to do it without using code? I'm like you, so lost! And can't find any videos to link database to dropdown menu, which sounds like much easier to me, but apparently not... If you have found the way, please let me know. Thanks ;)

  • @markbennis4034
    @markbennis4034 3 года назад +1

    Is there a way to create a set of drop down menus without using code? Example for me anyway: say a repeater for an index. the index is for a directory. I am having serious trouble trying to make my datasheet filter the results in my index? Any suggested videos that are not in the matrix?? i.e - not code implemented? its been 20 videos later and I keep watching code inputs at the end.

  • @alecampa1006
    @alecampa1006 3 года назад

    it worked smoothly in editor X, thank you!

  • @AlexDraganP
    @AlexDraganP 4 года назад +5

    To solve the button problem.. You have to sent the function on Click action on the button. This thing it's not said in the tutorial, but I think it's essential, I've spent 5 hours to find what's the problem

    • @woontianruen8518
      @woontianruen8518 4 года назад

      Hi, can you explain more about this? I still can't solve it. Thanks

    • @aamir_xo
      @aamir_xo 4 года назад

      ​@@woontianruen8518
      1. Right click on the button and select 'View Properties'. (if you can't find 'View Properties', press F11 on the keyboard to go full screen, then right click and you'll be able to find it at the bottom)
      2. In the properties window, under the 'Events' column, go to 'onClick' and click the '+' button beside it.
      3. The code window will open with "export function button1_click_1(event) {" already printed.
      4. Continue writing the code as shown in the video.
      5. Make sure you add $w to the already printed function line i.e. turn this "export function button1_click_1(event) {" into "export function button1_click_1(event, $w) {" this.

    • @Mattyg331
      @Mattyg331 4 года назад

      @@aamir_xo I've tried the above but doesn't seem to work. As far as i can tell i have input the code correctly, but the search button doesn't seem to action it. My code is below:
      import {wixData} from 'wix-data';
      export function button1_click1(event, $w) {
      $w("#dataset1").setFilter(wixData.filter()
      .ge("bathrooms", $w('#dropdown1').value)
      .ge("bedrooms", $w('#dropdown').value))
      .then((results) => {
      console.log("Dataset is now Filtered");
      $w("#listRepeater").data = results.items;
      })
      .catch((err) => {
      console.log(err);
      });
      $w("#listRepeater").expand();
      }

    • @aamir_xo
      @aamir_xo 4 года назад

      ​@@Mattyg331 Hi,
      You can try making it such that the results change when you select something from the dropdown menu, rather than changing on clicking the button(since the button don't seem to work). That's how I did it, might not be exactly how you want it, but if it works...
      To do so, click 'View Properties' on the dropdown menu, and choose "onChange:" then write the same code under it. Also I didn't add "$w" on my site and it seems to work fine.
      import {wixData} from 'wix-data';
      export function dropdown1_change(event) {
      $w("#dataset1").setFilter(wixData.filter()
      .ge("bathrooms", $w('#dropdown1').value)
      .ge("bedrooms", $w('#dropdown').value))
      .then((results) => {
      console.log("Dataset is now Filtered");
      $w("#listRepeater").data = results.items;
      }).catch((err) => {
      console.log(err);
      });
      $w("#listRepeater").expand();
      }
      Also, make sure you're using proper FieldKeys and button/dropdown IDs.

    • @Mattyg331
      @Mattyg331 4 года назад

      @@aamir_xo Amazing that seems to have done the trick. Do you then have to repeat the export function multiple times for each dropdown? It works for bedrooms but not for bathrooms.
      Also looking at doing "price from" and "price to"
      Thanks for your help!

  • @linaabadir6745
    @linaabadir6745 5 лет назад +4

    Can you show us how you filled the property Type drop down ? what is the default value??

  • @MarkBoxeo
    @MarkBoxeo 3 года назад

    Hi how did you get the bedroom, toilet and for sale signs on your listings?

  • @JessRobinsM
    @JessRobinsM 4 года назад +3

    How did you insert icons into the product descriptions?

    • @MarkBoxeo
      @MarkBoxeo 3 года назад

      Hi Jess, did you ever figure this one out ?

  • @javieraranda2952
    @javieraranda2952 3 года назад +1

    How to add and setting up the button "search"?

  • @evelynedeboer7132
    @evelynedeboer7132 3 года назад

    Is there also an option when selected the certain filters, when not happy with these filters, to go back and search for "all" again. For example with the Property Type I selected "Villa" , But I want to go back to where I started (so everything with House, Apartment, Villa AND Land". Does someone have an idea?

  • @dudakingroots
    @dudakingroots 6 лет назад +2

    Very good your video, but would be of much help if you post the code that you created! Thank you again!

  • @williamjamesrapp7356
    @williamjamesrapp7356 4 года назад

    **QUESTION** I have a WIX website I am building where I will have a particular DB where customers will come and Fill out a data form and submit their information to the database. I want this DATABASE to work so that when the Customer enters the DATA into the database THAT DATA IS NOT VISIBLE to ANYONE ELSE -- Just Me in the Admin section and the Customer who entered the correct information.
    I was wondering that If I add a Key Data in the Database that the Customer enters a PASSWORD they create so that at a later time if that Customer was to view their data they entered the only way they can retrieve it would be to ( in the SEARCH TOOL ) ENTER THE PASSWORD that they Entered AND their email and only then would their Data Show up. IS THAT POSSIBLE TO CREATE HERE WITHOUT A BUNCH OF SPECIAL CODE ??? DO I NEED TWO (2) search bars to require BOTH forms of Identity they enter to retrieve their data-set of information ???

  • @barankurt4316
    @barankurt4316 2 года назад

    Can you make a filter with province, district, neighborhood, categories? I want the cards suitable for filtering to be listed after the province, district, neighborhood categories are selected.

  • @ExpatGlobetrotter
    @ExpatGlobetrotter Год назад

    Ugh! To much for me. Do you do side work? If so, how do I contact you?

  • @melindabojte3680
    @melindabojte3680 5 лет назад

    The bathrooms filter is not working for me,the elements from the dropdown simply won't react/filter through the numbers in the database,what setting you do in the database?and in the dropdown menu?

  • @qingli5577
    @qingli5577 3 года назад

    After I create the dropdown1, and did a preview, when the filter results show up, the search field text disappeared in dropdown 1. Can anyone help to fix it? Thanks

  • @aamir_xo
    @aamir_xo 4 года назад +3

    Hello everyone, if this isn't working for you, probably the button function has not been set. To do just that:
    1. Right click on the button and select 'View Properties'. (if you can't find 'View Properties', press F11 on the keyboard to go full screen, then right click and you'll be able to find it at the bottom)
    2. In the properties window, under the 'Events' column, go to 'onClick' and click the '+' button beside it.
    3. The code window will open with "export function button1_click_1(event) {" already printed.
    4. Continue writing the code as shown in the video.
    5. Make sure you add $w to the already printed function line i.e. turn this "export function button1_click_1(event) {" into "export function button1_click_1(event, $w) {" this.
    Also, if you are confused about "#repeater1", you can add repeaters to your page. To do that click on "Add" button in the left side menu, and search "repeater".

  • @simmixo
    @simmixo 4 года назад

    My filter is coming up twice so there’s two for size and two for colour and then it won’t let me get a custom filter or delete the extra option

  • @AstroForumSpace
    @AstroForumSpace 5 лет назад

    Great, exactly what I was looking for. I'm going to try this. edit: it works, but when I add two number dropdown items to the code using parsefloat, both dropdowns have to be selected, before the repeater shows the results...

  • @williamjamesrapp7356
    @williamjamesrapp7356 4 года назад +1

    ***QUESTION***
    I am building a DATABASE where Individuals can enter data into the database so that at a later time they can retrieve that data.
    The trick is I want ONLY the person who enters THEIR DATA to be able to retrieve ONLY THEIR DATA from this DB.
    Could I have a data entry be a PASSWORD that the Customer Enters WHEN they first fill out the data form.
    THEN at a later time the only way they can RETRIEVE their data is by IN THE SEARCH TOOL ENTER their PASSWORD to retrieve their set of data they entered OR MAYBE their PASSWORD and their LAST NAME as the KEY to retrieve the data AND NO ONE ELSES DATA should appear.
    IS THIS POSSIBLE or will the search automatically pull up all similar PASSWORDS and NAMES ???

  • @uroszec5397
    @uroszec5397 4 года назад

    If I use same principle for new dropdowns and new filters in codes, will it work?
    I tried to add more dropdowns and use same principle in code (it doesnt show red dot-no errors), but doesnt work that new dropdowns. Can anyone explain how to add more dropdowns ? Thanks in advance

  • @sangtippuangnak453
    @sangtippuangnak453 4 года назад +1

    Anyone please help, I couldn't make the price filter to work. :(
    The rest is working, except price filter.........

  • @mb6019
    @mb6019 5 лет назад +1

    Thank you so much for this tutorial it was really helpful!

  • @elliottreynolds
    @elliottreynolds 4 года назад

    *QUESTION* - I keep getting Errors when you try and filter without the price, if you don't select anything on the price it will not find results. Once you select, no minimum and no maximum it will then search

  • @egemes5403
    @egemes5403 5 лет назад +5

    This part of the code shows error on my end }); Can you assist?

    • @maxbrt7409
      @maxbrt7409 5 лет назад +1

      Me too I don't how to repair it please help me...

    • @sebwo8319
      @sebwo8319 5 лет назад

      @@maxbrt7409 did you find a solution?

    • @sebwo8319
      @sebwo8319 5 лет назад

      did you find a solution to this problem?

    • @lepsveridze100
      @lepsveridze100 4 года назад

      @@sebwo8319no

    • @alemrivasr
      @alemrivasr 4 года назад

      did you add the first part, the one he said doesnt matter? I get the same error but dunno if that is the problem

  • @zl1651
    @zl1651 4 года назад

    Is there a way to filter based on tagging. I don't want to use a dropdown. I want all the words to be visible on the page, so the filter happens when a word is selected.

  • @syifaa4760
    @syifaa4760 4 года назад

    can anyone help me, why does it show export function button14_click? Where did the button come from?

  • @priyeshgupta6291
    @priyeshgupta6291 4 года назад

    Can someone let me know what does he use to display the houses below the dropdowns. Like if its a shop or product gallery or anything else. Thanks in advance

  • @julioylosabes1940
    @julioylosabes1940 3 года назад

    By the way the code work with but give the next error: TypeError: Cannot read properties of undefined (reading 'items')

  • @dounianassik3518
    @dounianassik3518 5 лет назад

    Great video, It's what I'm looking for. Thank you so much

  • @roaster476
    @roaster476 2 года назад

    I don't know about the codes..how can I get over it.

  • @advertisemedia1509
    @advertisemedia1509 5 лет назад

    whats that top code... box3 and all plz let me know

  • @briankarol1803
    @briankarol1803 6 лет назад

    Hi Tiaan, I followed your code exactly. Job well done! I did however come across an error. "TypeError: Cannot read property 'items' of undefined". Any advice to fix this? I was thinking it could be the type of list/grid I am using. Any help would be much appreciated!

    • @linaabadir6745
      @linaabadir6745 5 лет назад

      hey Brian , i got the same error how did ya solve it ?

    • @m1pro678
      @m1pro678 5 лет назад

      i have the same problem!

    • @sebwo8319
      @sebwo8319 5 лет назад

      any solution to this guys?

    • @turimessina2755
      @turimessina2755 5 лет назад

      me too :(

    • @sebwo8319
      @sebwo8319 5 лет назад +1

      @@turimessina2755 I solved by correcting my filter keys and making sure that they are all in the exact same format. Capital letters, spaces and so on.:)

  • @DanBorgia
    @DanBorgia 5 лет назад

    Good video, man! Thanks.

  • @gunjangoel7029
    @gunjangoel7029 3 года назад

    can u tell me the name of the template?

  • @danielkidd6686
    @danielkidd6686 5 лет назад +2

    Dear Dev i have used the below code however it is coming up with errors when i preview the page, please see the below code i used and then underneath that the errors that pop up, to be clear i am only filtering words not numbers, please help.
    please see below code i used.
    export function button14_click(event) {
    $w("@").setFilter(wixData.filter()
    .contains("type", $w('@').value)
    .contains("colour", $w('@').value)
    .contains("age", $w('@').value)
    .then((results) => {
    console.log("Data set is now filtered");
    $w("@").data = results.iterms;
    }).catch((err) => {
    console.log(err);
    });
    $w("@".expand();
    }
    and below are the errors thar pop up on the preview page
    public/pages/eci5t.js: Unexpected token, expected , (22:3)
    20 | }).catch((err) => {
    21 | console.log(err);
    > 22 | });
    | ^
    23 | $w("#repeater3".expand();
    24 | }
    please help it would be appreciated

  • @m-studioz9078
    @m-studioz9078 4 года назад +1

    Can you send me the template please

  • @alikemalozk
    @alikemalozk 4 года назад +1

    Can you share the codes please?

  • @madalinanyc1
    @madalinanyc1 4 года назад

    thanks! super useful

  • @muhammadazfaraslam8610
    @muhammadazfaraslam8610 4 года назад

    How to filter results in a new tab? Anyone, please help?

  • @billc3924
    @billc3924 5 лет назад

    how do you put a hover in a repeater??

    • @truthsearch9225
      @truthsearch9225 4 года назад

      you can't. you can only put things with the connect to data icon, which shows up when you hover your mouse over the element in the wix editor.

  • @iantaylor7520
    @iantaylor7520 3 года назад +1

    Good Morning/Afternoon, are you still in business need help with real estate website.
    Take care
    Ian

    • @helpvid
      @helpvid 3 года назад

      I can help, please DM me

  • @spyrossarides5168
    @spyrossarides5168 5 лет назад +1

    Hi there, Could you undertake a small project? Thanks in advance.

    • @helpvid
      @helpvid 3 года назад

      I can yes please DM me

  • @aaronkofigayi2905
    @aaronkofigayi2905 5 лет назад +3

    The annoying thing is that the most important thing which is how the fillter drop down is created you never spoke about and you are just talking about price are you selling us the properties

    • @sarahhusna4215
      @sarahhusna4215 4 года назад

      exactly...

    • @alemrivasr
      @alemrivasr 4 года назад

      those are normal dropdowns, the filter runs in the code depending on the dropdown selection

    • @kahanikiawaz1084
      @kahanikiawaz1084 3 года назад

      @@alemrivasr send your mail adress plz

  • @williamjamesrapp7356
    @williamjamesrapp7356 4 года назад +3

    Interesting IDEA HOWEVER this video is not very helpful to someone who is trying to learn. You kinda go through the information as if everyone knows what you are talking about but to a novice I MYSELF AM JUST LOST because you do not explain what you are doing YOU JUST SAY DO THIS AND THIS. I myself do not want to create a House Listing Search so different information and not sure what you are talking about has me just lost without explanations. :(

  • @akashamale6277
    @akashamale6277 3 года назад

    Where is the code? You didn't even show us the dataset for better understanding

  • @uppertrash4
    @uppertrash4 5 лет назад +3

    Have spent hours trying to make this work. Nothing is happening when i click the search button... Any ideas?

  • @aravindkurushev
    @aravindkurushev 5 лет назад

    Thanks for that!

  • @jayjagannath3797
    @jayjagannath3797 5 лет назад

    error
    error
    error
    not functioning

  • @frankielumbar1186
    @frankielumbar1186 4 года назад

    If you're looking for info on how to create some of the other elements of this tutorial, such as drop-downs or the property info (known as a repeater), here are some resources: DROPDOWNS - support.wix.com/en/article/adding-and-setting-up-a-dropdown-list REPEATERS - ruclips.net/video/_alvC9kPDNA/видео.html

  • @hasnanaminul
    @hasnanaminul 5 лет назад

    Fuck sake explain the dataset1 bit mate. Done everything and my page does nothing. Nothing spits to the console too.

  • @orxanisrafilov3139
    @orxanisrafilov3139 2 года назад

    nor work alreadyt

  • @ladawda
    @ladawda 5 лет назад

    CONFUSEDDDDD

    • @melsemail1641
      @melsemail1641 5 лет назад

      is it working for you?the whole thing seems to be missing a part,i dont know

  • @milkoserafinisantoro5604
    @milkoserafinisantoro5604 3 года назад

    No funciona el algoritmo...

  • @danielkidd6686
    @danielkidd6686 5 лет назад

    Dear Dev i have used the below code however it is coming up with errors when i preview the page, please see the below code i used and then underneath that the errors that pop up, to be clear i am only filtering words not numbers, please help.
    please see below code i used.
    export function button14_click(event) {
    $w("@").setFilter(wixData.filter()
    .contains("type", $w('@').value)
    .contains("colour", $w('@').value)
    .contains("age", $w('@').value)
    .then((results) => {
    console.log("Data set is now filtered");
    $w("@").data = results.iterms;
    }).catch((err) => {
    console.log(err);
    });
    $w("@".expand();
    }
    and below are the errors thar pop up on the preview page
    public/pages/eci5t.js: Unexpected token, expected , (22:3)
    20 | }).catch((err) => {
    21 | console.log(err);
    > 22 | });
    | ^
    23 | $w("#repeater3".expand();
    24 | }
    please help it would be appreciated

    • @elliottreynolds
      @elliottreynolds 4 года назад +1

      use this code.
      import wixData from 'wix-data';
      export function button26_click (event, $w) {
      $w("#dataset1").setFilter(wixData.filter()
      .contains ("typeOfArt", $w('#dropdown2').value)
      .between("price",parseFloat($w('#dropdown1').value),parseFloat($w('#dropdown4').value)))
      .then((results) => {
      console.log("Dataset is now filtered");
      $w("#repeater1").data = results.items;
      }).catch((err) => {
      console.log(err);
      });
      $w("#repeater1").expand();