Hi All, Need a bit of help, I have a repeater from a dataset which have filtering on “status” to only show “pending” status.
how do I update the database once the button is clicked? and then refresh the dataset repeater display?
this is my current code.
$w . onReady ( function () {
const date = new Date ();
let day = date . getDate ();
let month = date . getMonth ()+ 1 ;
let year = date . getFullYear ();
let dateStr = day + “/” + month + “/” + year ;
$w ( ‘#dataset1’ ). onReady (() => {
console . log ( “dataset ready” );
$w ( “#repeater1” ). forEachItem (( $item )=>{
console . log ( “repeater ready” );
$item ( ‘#updateStatusButton’ ). onClick (( event ) => {
let updateStatus = {
“currentEmail.dateUpdated” : dateStr ,
“currentEmail.status” : “completed”
}
wixData . update ( “withdrawl” , updateStatus )
console . log ( “status updated” );
$w ( ‘#dataset1’ ). refresh ();
console . log ( “dataset refresh” );
})
});
})