Modal or Modeless - Which type of dialog boxes to use?

74 views
Skip to first unread message

Alan Wells

unread,
Jun 6, 2019, 6:28:22 PM6/6/19
to Google Apps Script Community
I'm going to switch to using Modeless dialog boxes.  The modeless dialog box allows the user to click on things outside of the dialog box.  And the vertical scroll bar works with Modeless.  The vertical scroll bar is disabled for a modal dialog box.  With the recent problem with Google Forms, a modeless dialog box would have allowed the users to still be able to use the dialog boxes.

DOC_MAIN_CLASS.getUi().showModelessDialog(hOutput,theTitle);

I use a global variable for the document highest level app class.

FormApp
DocumentApp
SpreadsheetApp

var DOC_MAIN_CLASS;//Define global but dont assign it a value


function setDocMainClass_() {
  //Only set a global from inside of a function or there may be an error
 
if (!DOC_MAIN_CLASS) {
    DOC_MAIN_CLASS
= FormApp;//Or whatever xxxxApp
 
}
}

setDocMainClass_
();//Runs this function every time that any code runs


Reply all
Reply to author
Forward
0 new messages