Search Results

I need some code for my search results to work.
Names for code: “Count” —> “wynikiwyszukiwania”

look my page https://dariuszgardon00.wixsite.com/strona/kopia-articles

The given link of you will not work.
Just Velo-Masters are able to take a look onto your editor.

What exactly are you trying to achieve?
Perhaps you want to give some more details about your project and your aim.

1 Like

https://dariuszgardon00.wixsite.com/stronaglowna/zdjecia

@zgredzio010
Like Russian-dima said,
what are you trying to achieve?
The number of results that are returned?

@volkaertskristof number of results found

@zgredzio010
Take alook onto this simple example, perhaps you will find your answer here…
https://russian-dima.wixsite.com/meinewebsite

1 Like

@zgredzio010
What you have to do is.
add an onChange event on the dropdown,
then add the length of the dataset to a textfield.
$w(“#yourTextField”).text = $w (“#yourDataset”). getTotalCount ();

@volkaertskristof export function count_viewportEnter(event) {
$ w ( “#count” ) .text = $ w ( “#dataset1” ). getTotalCount ();

in the first picture I selected the drop-down menu because it doesn’t expand after that

I don’t know if I understood correctly

@zgredzio010 You have extraneous spaces in this line:

$ w ("#count") .text = $ w ("#dataset1"). getTotalCount ();

You want this:

$w("#count").text = $w("#dataset1").getTotalCount ();

@yisrael-wix
This here happens…

$ w ("#count") .text = $ w ("#dataset1"). getTotalCount ();

…when using google-translator ! :roll_eyes:

1 Like

@russian-dima heh yea i know

1 Like

@russian-dima
@yisrael-wix


i dont know… i used code and don;t work

Check all the brakets in your code.

In your screen shot of the code error, you will see that there is a space between getTotalCount and ().

You have:

$w("#count").text = $w("#dataset1").getTotalCount ();

Get rid of the space, and you should have:

$w("#count").text = $w("#dataset1").getTotalCount();

You can’t assign a number to a text element, and your function needs a closing bracket. Your function should look like this:

export function count_viewportEnter(event) {
   $w("#count").text = $w("#dataset1").getTotalCount() + ''; // make into a string
}
1 Like

@yisrael-wix hmm bro it works a bit, but it does not refresh immediately, only when I scroll down, for example, and I go back to the top, then I show the correct number.
U understand?

@yisrael-wix Select select “Logo” Scroll down and up

@zgredzio010 It only works when you scroll down since you update the field in a viewPortEnter() event handler. If you need it to update at another time, then you’ll have to find the correct place to update.

@yisrael-wix or? because I do not understand?
how to make it update immediately?