Select to view content in your preferred language

Add loading icon to url button custom widget

2333
10
Jump to solution
03-03-2019 01:27 PM
CarolineBettach
New Contributor

 Do you know how can i change your url button code custom widget and add a loading icon that will be s display when clicking on the button on will be hidden when the service will return a response?

0 Kudos
10 Replies
RobertScheitlin__GISP
MVP Emeritus

Caroline,

   You just have to hitch your result and error function to the current scope of this.

requestHandle.then(
  lang.hitch(this, function (response) {
    var responseJSON = JSON.stringify(response, null, 2);
    //alert(responseJSON);
    this.loadingPanel.hide();
    this.isOpening = false;
    WidgetManager.getInstance().closeWidget(this);
  }),
  lang.hitch(this, function (error) {
    //alert( error.message);
    this.loadingPanel.hide();
    this.isOpening = false; 
    WidgetManager.getInstance().closeWidget(this);
  })
);