Setting repeater values from database

212 views Asked by At

I have this code

$w("#repeater1").forEachItem( ($item, itemData, index) => {
                $item("#image2").src = reviews[count].ReviewerImage;
                $item("#text17").text = reviews[count].ReviewerComment;
                $item("#text28").text = reviews[count].ReviewerNickname;
                $item("#ratingsDisplay1").value = reviews[count].ReviewerRating;
                count++;
            } );

When this runs, it updates the information in the repeater based on the information in the array reviews. The nickname, comment, and image all are being displayed correctly, but the ratings on the repeater are not updating with the rest of the data. I have tried console logging the 'reviews[count].ReviewerRating' which outputs a value of 5 for each item, but when the page loads, it the ratings display only shows 3 stars. Is there an event I need to trigger to update the reviews?

1

There are 1 answers

0
The Traveling Coder On
$w("#repeater1").forEachItem( ($item, itemData, index) => {
    $item("#image2").src = reviews[count].ReviewerImage;
    $item("#text17").text = reviews[count].ReviewerComment;
    $item("#text28").text = reviews[count].ReviewerNickname;
    $item("#ratingsDisplay1").rating= reviews[count].ReviewerRating;
    count++;
} );

Had to set the ratings display with .rating instead of .value