as the title describe i want populate the data that i just inserted into my data base right away after it being inserted
i tried a lot but it just not working , i have to refresh the page to be populated
this is my failure code :
ction getdata() {
let query = wixData.query('visits')
return query.limit(1000).find().then((resaults) => {
console.log('getdata', resaults)
return resaults.items
});
}
$w.onReady(function () {
let ii = $w("#dynamicDataset").getCurrentItem()
$w("#dataset1").setFilter(wixData.filter()
.eq("idPatient", ii._id));
$w('#button2').onClick(() => {
let toInsert = {
"idPatient": ii._id,
"quadrant": $w('#dropdown1').value,
"toothnumber": $w('#input1').value,
"premeasure": $w('#dropdown2').value,
"detail": $w('#textBox1').value,
"date": currentdate
};
wixData.insert("visits", toInsert)
.then((results) => {
let item = results; //see item below
})
.catch((err) => {
let errorMsg = err;
});
$w('#textBox1').value = ''
getdata().then((items) => {
$w('#repeater1').data = items
})
})
});
any ideas????
@AmandaM
Have you tried calling refresh on dataset after submit?
$w("#myDataset").refresh()