Hello,
always in my intent to learn the code I came across this need:
Within a function I have an event on a table that generates two variables.
These two variables I would like to recall them when I call the function.
function buttomActivated() {
$w(“#TabEventi”).onRowSelect( (event) => {
const index = event.rowIndex;
const idRows = event.target.rows[index]._id;
let AttivoRows = event.rowData.attivo;
let NameRows = event.rowData.nomeEventoOErimonia;
if (AttivoRows === undefined) {
$w(“#serviceActivate”).disable();
$w(“#serviceActivate”).label = ‘-’;
$w(‘#serviceName’).hide();
}else {
$w(‘#serviceName’).text = NameRows;
$w(‘#serviceName’).show();
$w(“#serviceActivate”).enable();
if (AttivoRows === true) {
$w(“#serviceActivate”).label = ‘Disattiva’;
AttivoRows = false;
}else {
$w(“#serviceActivate”).label = ‘Attiva’;
AttivoRows = true;
}
}
});
return(idRows, AttivoRows);
}
export function serviceActivate_click() {
let pipo = buttomActivated();
console.log('Test ’ + pipo);
}
With this code I tried to do there are two questions:
Can I apply two variables to the return?
If I apply the return it must now give me a undefine error, rightly since these are within the onRowSelect event.
How can I transfer these two variables?
I hope I explained myself in the best way, and I hope so much that someone can help me because this case happens to me often
Thank you