Here is the code I am using. “wixData” is underlined in red. I don’t know if this should be called something else? Does anyone know how to fix this issue?
let searchQuery;
let mockDataQueryResult;
let data = ;
let startRow = 0;
let limit = 10;
async function performSearch() {
searchQuery = $w(“#searchQueryInput”).value;
mockDataQueryResult = await wixData (“MockData”)
.contains(“Title”, searchQuery)
.limit(limit)
.skip(startRow)
.find();
// Update the 'data' array with the filtered data
data = mockDataQueryResult.items;
// Display the first page of data
const displayedData = data.slice(startRow, startRow + limit);
$w('#Table').rows = displayedData;
}
$w(‘#searchButton’).onClick(performSearch);
$w(‘#ClearFilterButton’).onClick(() => {
searchQuery = null;
$w(‘#searchQueryInput’).value = “”;
// Reset the 'data' array to an empty array
data = [];
// Reset the table rows to an empty array
$w('#Table').rows = data;
});Preformatted text