Page 2 of 2

Re: save form without full redraw

Posted: Fri Jun 10, 2022 5:20 am
by kev1n
Can you give this a try? The variable openPopup is only defined if it is undefined.

Code: Select all

if(typeof openPopup === 'undefined') {
	var openPopup = false;
}

function fillSotrPopup(){
    let arrRows = nuSubformObject('sf_yavka').rows;
    let arrChecked = [];
    for (let index = 0; index < arrRows.length; ++index) {
        arrChecked.push(arrRows[index][1]);
    }
    localStorage.setItem("arrChecked", JSON.stringify(arrChecked));
    nuPopup('627e8e6691182e4', '', '');
}

function selectSotr(){
  if (nuIsNewRecord()) {
        openPopup = true;
        nuSaveAction();
    } else {
        openPopup = false;
        fillSotrPopup();
    }
}

function nuAfterSave(){
    if (openPopup === true) {
        openPopup = false;
        fillSotrPopup();
    }
}