Thursday 25 June 2015

Nintex Forms show loading dialogue for required time

One of our Nintex Form has complex Javascript which queries web services and loads meta data. For this operation, the javascript runs for few seconds and we want user not
  1.  To start typing on any field of form or accessing the form before it loads all meta data
  2.  To complain that form is incomplete before it loads all meta data
For this we can add below Javascript to show loading animation to user so that user can wait without complaining. It gives better usability.

$(window).load(function () {

waitDialog = SP.UI.ModalDialog.showWaitScreenWithNoClose('   ', 'Please wait...', 110, 280);
   
setTimeout(function () {  
waitDialog.close();
    }, 5000);
});

JQuery has to be referenced in Nintex Form. It uses SharePoint's native modal dialog.

No comments: