Hi currently Im using this code to load data from the database and filtering it with onClick function. My page is loading very slow and I’m not able to enter data in the Text Box. After some research, I found that Async function loads data comparatively faster from the database. I’m new to code and want to convert it to the async function.
import wixData from 'wix-data';
$w.onReady(function () {
$w('#table1').collapse();
});
export function submitButton_onClick() {
wixData.query('Datacollection')
.contains('hallNo', $w('#Textinput1').value)
.find()
.then(res => {
$w('#table1').rows = res.items;
$w('#table1').expand();
});
}