Loader on Save

Forums General discussion Loader on Save

Tagged: 

  • This topic has 4 replies, 2 voices, and was last updated 4 years ago by HYM.
Viewing 4 reply threads
  • Author
    Posts
    • #28657
      HYM
      Participant

      Hi Alex, is it possible to use the same loader off the dffs when saving a form? to not let the user do any changes until the validation is completed and in case of missing info of course the loader will disappear ?

    • #28659
      Alexander Bautz
      Keymaster

      Not sure what you mean – do you mean a “Saving the form, please wait” dialog? – if so, you can use something like this in the dffs_PreSaveAction function in Custom JS:

      var dlgId = spjs.modal.add({
          "title":"Saving the form",
          "html": "<div style='height:30px;'><img src='"+_spPageContextInfo.webServerRelativeUrl+"/_layouts/15/images/gears_anv4.gif' style='vertical-align:middle;margin-right:10px;'>Please wait...</div>",
          "width": 250,
          "showFooter": false,
          "showClose": false,
          "allowMaximize": false,
          "resizable": false
      });
      setTimeout(function(){
          spjs.modal.cancel(dlgId);
      },10000);

      This will auto close after 10 seconds in case there are some kind of error saving the form .

      Alexander

    • #28661
      HYM
      Participant

      okay thanks, and if i need to close the dialog after spjs.dffs.triggerSave() is done?

    • #28679
      Alexander Bautz
      Keymaster

      If you look at the code you find it:

      spjs.modal.cancel(dlgId);

      But please note that dffs_PreSaveAction will not trigger until all validation is completed so if you plan to do some kind of custom validation you must add the modal dialog in your custom save function before calling triggerSave.

      Alexander

    • #28682
      HYM
      Participant

      Yes ofc it’s the spjs.modal.Cancel, i thought that the dffs_presave action will be triggered with the validation thanks for make it clearer

Viewing 4 reply threads
  • You must be logged in to reply to this topic.