Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.


Excerpt

The reference shows the full usage of the custom dashboard loaders for Squirro dashboards.

...

.


Info

This article is now outdated by two new features of Squirro. Please see:
Styling Squirro > App & Nav Bar
Styling Squirro > Themes

This article still serves as a nice reference for working with dashboard loaders. For theming, changing logos etc we recommend using the two features above.


Each of the main components of a custom dashboard loader has its own section: JavaScript, CSS.

...

FileTypeExplanation
loader.jsJavaScriptThe executable code of the dashboard loader. This file is loaded together with the dashboard.
loader.cssCSSThe CSS of the dashboard loader.

Additionally a number of CSS files can be included in a loader. They will all be made accessible to the loader code.

...

The main entry point to a loader is the customLoad() method. This method should be implemented in a custom loader and is executed before any dashboard content is loaded.

Loading custom CSS

Please note that the loader.css file gets loaded by default since Squirro version 2.6.4.

Code Block
languagejs
titleloader.js
return Loaders.Base.extend({
    customLoad: function () {
        this.customResources['loader.css']();
    },
});

...

It's not mandatory but we recommended developers give custom CSS class names to widgets that are being changed by dashboard loaders, this allows other developers to better understand what is being changed later on and gives you some additional specificity when changing cssCSS. See the image below available on all widgets. (Custom CSS Class Name)

...