Hi I’m trying to delete an item from my dataset using code, then re-set the dataset to show the most recent changes in the repeater. The button is placed on the repeater.
I have this so far but it’s not working:
export function iconButton1_click(event, $w) {
let item = $w("#dataset1").getCurrentItem();
let title = $w("#text153").text; // key generated as page loads so the filter has something to match tp
wixData.remove("images", item)
$w("#dataset1").onReady( () => {
$w("#dataset1").setFilter(wixData.filter().eq("title", title)); // should filter dataset to match text153
})
}
I’ve added this to my code but nothing seems to be working with the refresh of the dataset on the screen
export function iconButton1_click(event, $w) {
let item = $w("#dataset1").getCurrentItem();
let title = $w("#text153").text; // key generated as page loads so the filter has something to match tp
wixData.remove("images", item)
.then( () => {
$w("#dataset1").refresh()
console.log("Done refreshing the dataset");
} );
$w("#dataset1").onReady( () => {
$w("#dataset1").setFilter(wixData.filter().eq("title", title)); // should filter dataset to match text153
})
}
I’m not sure if I’ve followed your instructions correctly? I’m assuming not!