Hi, I’m trying to make a button on off that when it’s on gives me the possibility to delete the rows of a table
I’m learning javascript if someone can explain how to correct this code thanks
function onoff() {
if $w(“#BottDeleteRecord”).value() === enable {
$w(“#BottDeleteRecord”).disable();
}else{
$w(“#BottDeleteRecord”).enable();
}
export function BottDeleteRecord_dblClick() {
onoff();
if $w(“#BottDeleteRecord”).enable=== true() {
export function TabEventi_rowSelect(event, $w) {
const index = event.rowIndex;
//get the _id attribute of the relevant record
const idToDelete = event.target.rows[index]._id;
//remove the record from the collection
wixData.remove("RedirectCerimonie", idToDelete)
.then(() => {
//refresh the table with the updated info
$w('#TabEventi').refresh();
})
.catch((err) => {
let errorMsg = err;
console.log(errorMsg);
});
}
}
}
Thanks