I’m not sure. I’m trying to find that out here.
So in the meantime what I learn was that, on initial loading of the page, the repeater includes a record with missing fields (Empty fields). But when I “Filter” and then cancel the filter (Clear filter), the record that is empty is no longer there. So it is only an issue on initial loading of the page.
The code I posted above is the initial loading code.
The clear Button function has the following code:
export function clearSearchButton_click(event) {
$w('#searchInput').value = "";
$w('#positionDropdown').value = $w('#positionDropdown').placeholder;
$w('#regionDropdown').value = $w('#regionDropdown').placeholder;
$w('#preferredFootDropdown').value = $w('#preferredFootDropdown').placeholder;
$w(`#playerRepeater`).data = originalRows;
$w(`#playerRepeater`).onItemReady(($item, itemData, index) => {
console.log("Clear");
console.log(itemData);
$item(`#text48`).text = itemData.fullName;
$item('#image10').src = itemData.profileImage;
$item('#text51').text = itemData.dateOfBirth;
$item('#text52').text = itemData.position;
$item('#text53').text = itemData.region;
$item('#text59').text = itemData.preferredFoot;
$item('#text60').text = itemData.footballClub;
});
}
And this seems to work fine as it does not display the empty record!?