Custom loading spinner

Forum to discuss the new web client version of Servoy.

Custom loading spinner

Postby jay.rao » Mon Dec 04, 2017 12:40 pm

Hello,


I want to use my custom spinner instead of servoy default 'wait' spinner whenever there is something going in backend. I created my custom service to replace the '$sabloLoadingContainer' so that whenever there is something on going in backend my screen has my spinner.
Code: Select all
angular.module('loadingindicatorLoadingIndicator',['servoy'])
.factory("loadingindicatorLoadingIndicator",function($services,$window,$sabloLoadingIndicator)
{
   var scope = $services.getServiceScope('loadingindicatorLoadingIndicator');
    return {
           showLoading: function() {
            $($window.document.body).css({"cursor":"help"});
           },
           hideLoading: function() {
               $($window.document.body).css({"cursor":"auto"});
           }
       }
})
.run(function($rootScope,$services)
{
   var scope = $services.getServiceScope('loadingindicatorLoadingIndicator')
   scope.$watch('model', function(newvalue,oldvalue) {
   // handle state changes
      console.log(newvalue)
}, true);
})


But the problem is I am confused the point that I can manually use my services 'plugins.loadingindicatorLoadingIndicator.showLoading()' but this is not a good approach. I want to replace my spinner with servoy spinner instead of manually calling the show/hide load.
The document says ' don't use this service directly to set or hide the indicator, always use the $sabloLoadingIndicator.' I am unclear on this part,because i don't want to manually call anything to load this spinner.


Regards,
Jay
jay.rao
 
Posts: 53
Joined: Mon Apr 10, 2017 1:32 pm

Re: Custom loading spinner

Postby jay.rao » Mon Dec 04, 2017 2:49 pm

I debugged websocket.js and fixed the issue so its resolved now.


Regards,
Jay
jay.rao
 
Posts: 53
Joined: Mon Apr 10, 2017 1:32 pm


Return to Servoy NGClient

Who is online

Users browsing this forum: No registered users and 2 guests