top of page

Item 1 do grupo A - Título teste

Código da página

import wixWindow from 'wix-window';

 

$w.onReady(function () {

$w("#dynamicDataset").onReady(() => {

$w("#dynamicDataset").refresh()

.then(() => {

console.log("Done refreshing the dataset");

});

 

});

});

 

export function iconButton1_click(event) {

 

let itemObj = $w("#dynamicDataset").getCurrentItem();

let databaseName = "grupoA"

 

wixWindow.openLightbox("Edit item", { itemObj, databaseName })

.then((data) => {

$w("#dynamicDataset").refresh();

});

 

}

Código da lightbox

import wixWindow from 'wix-window';

import wixData from 'wix-data';

import wixLocation from 'wix-location';

 

$w.onReady(function () {

let receivedData = wixWindow.lightbox.getContext();

 

$w("#input1").value = receivedData.itemObj.title;

 

$w("#button2").onClick((Event) => {

let toUpdate = {

"_id": receivedData.itemObj._id,

"title": $w('#input1').value,

};

 

console.log(toUpdate);

 

wixData.update(receivedData.databaseName, toUpdate)

.then((results) => {

let item = results; //see item below

})

.catch((err) => {

let errorMsg = err;

});

 

});

 

});

bottom of page