Ratings Display

I can add #ratingsDisplay to the site, but I can not manage it. According to the manual, it needs to be connected to the database, but this option is absent in the settings. How to connect the #ratingsDisplay to database?
Thank you!

Hey
Do you see the Data Connect Icon when you click the Ratings Display? Then you need a Dataset and a Data Collection with some data.

Hi Andreas!
I am grateful to you for the prompt reply!
I do not see the data connection icon when I click Rating Display. Probably, my editor either does not support data connection or for this a Premium plan is needed.


However, this code works:

export function ratingsDisplay1_viewportEnter(event) {
    $w("#ratingsDisplay1").rating = 2.5;
}

It remains to link the database data and the number of ratings, and this is not a problem.
Good luck to you!

Hey,
You can change the value using code (as you’ve already did). In order to do that, you can query the collection, get the relevant score and set it to the element.

I hope it’s clear.

Best,
Tal.

Hi, Tal!

I already wrote this code here.
If the hidden #text1 is connected to a data field with a rating

export function ratingsDisplay1_viewportEnter(event) {
    $w("#ratingsDisplay1").rating = Number($w("#text1").text);

But why is there no connection to the rating in my editor?
Thank you!

Hi, Tal!
If you use repeaters to display data from the database, the “query” is a somewhat cumbersome way to get the number for the rating.
Today I experienced a simpler code to show the rating from the database in the repeater (taking into account the changes that took effect on August 1). As in the previous example, the hidden repeated #text1 is connected to a field of the database with a rating.

export function ratingsDisplay1_viewportEnter_1(event) {
 let $item = $w.at(event.context)
     $item("#ratingsDisplay1").rating = Number($item("#text1").text)
}

Thank you!

Finally, I saw the icon for connecting the rating to the database in my editor. Those who saw it, too, forget about what I wrote above. Just connect the rating to the database.
Good luck!

Please can you help me out with showing the ratings display in the repeater?

Please see these two posts. Stevo is helping me but it seems its difficult for him too. Thank you