I have comment post section, where the comment posts are in a repeater. however when i preset the post button, the dataset is updated but the repeater is not refreshed to show the newest comment added. I will show when i refresh in the whole page. However in preview more the repeater will refresh.
export async function button5_click(event) {
//Add your code for this event here:
let $item = $w.at(event.context);
let toInsert = {
"title":$w('#textBox1').value,
"com_linked_question":$w('#dynamicDataset').getCurrentItem()._id,
"com_author":wixUsers.currentUser.id
}
wixData.insert('CommentPosts', toInsert);
$item("#dataset1").refresh();
$w("#dataset1").onReady( () => {
$w('#dataset1').refresh();
$item("#dataset1").refresh();
} );
$w('#textBox1').value = "";
$w('#button5').hide();
$w('#textBox1').hide();
$w('#button6').show();
}
@fahad Can you post your code with the AWAIT function. I am having trouble with refreshing the repeater and believe I need an await function but do not know how to set it up.