top of page

Dynamic Form Entry



Page Code:


import wixWindow from 'wix-window';

export function btnQuote_click(event) {
    let current = $w('#dynamicDataset').getCurrentItem();
    let dataObj = {
        "name": $w("#text16").text,
        "id": current._id
    }
    wixWindow.openLightbox("Quote", dataObj);
}

Lightbox Code:


import wixWindow from 'wix-window';
let receivedData = wixWindow.lightbox.getContext();

$w.onReady(function () {
    init();

    $w('#dataset1').onBeforeSave(() => {
        console.log("Continuing save");
        $w('#dataset1').setFieldValue("product", receivedData.id);

        return true;
    });
});

function init() {
    let option = [
        { "label": receivedData.name, "value": receivedData.id }
    ];
}

Enjoy!

Comments


bottom of page