Why this is so hard to achieve ![]()
Why wix doesn’t have this functionality?
Can this be done using wix-realtime? Below is my work around but it has a problem.
$w.onReady(function () {
setInterval(function(){ $w('#dataset1').refresh(); }, 500);
});
export function dropdown1_change(event) {
wixData.query("myDatabase")
.eq("name", $w("#dropdown1").value)
.find()
.then( (results) => {
let values = results.items[0];
values.inProgress = 2;
wixData.update("myDatabase",values)
})
$w("#input2").value = $w("#dropdown1").value;
$w("#input3").value = $w("#dropdown1").value;
$w("#dropdown1").value = "";
$w("#dropdown1").resetValidityIndication();
}
export function cancel_click(event) {
wixData.query("myDatabase")
.eq("name", $w("#input3").value)
.find()
.then( (results) => {
let values = results.items[0];
values.inProgress = 1;
wixData.update("myDatabase",values)
})
$w("#dropdown1").value = "";
$w("#input2").value = "";
$w("#input2").resetValidityIndication();
$w("#dropdown1").resetValidityIndication();
}
export function approved_click(event) {
wixData.query("myDatabase")
.eq("name", $w("#input3").value)
.find()
.then( (results) => {
let values = results.items[0];
values.inProgress = 3;
wixData.update("myDatabase",values)
})
$w("#dropdown1").value = "";
$w("#input2").value = "";
$w("#input2").resetValidityIndication();
$w("#dropdown1").resetValidityIndication();
}
