Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 9 Next »

The reference shows the full usage of the custom dashboard loaders for Squirro dashboards. Each of the main components of a custom dashboard loader has its own section: JavaScript, CSS, HTML.

Table of Contents

Files

On the local disk a Squirro custom dashboard loader is a folder. That folder contains a number of files that all have their purpose.

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

Managing Dashboard Loaders using the squirro_asset tool

The Toolbox comes with a command line utility squirro_asset which manages custom dashboard loaders and is documented at squirro_asset Command Line Reference.

JavaScript

Custom dashboard loaders are implemented as JavaScript objects deriving from the Loaders.Base class. The Loaders object is automatically exposed in the scope of the custom dashboard loader.

The template for a new loader.js file is as follows:

loader.js
return Loaders.Base.extend({
    // Class properties and methods here
});

Base Loaders

This example extends from the Loaders.Base base class. At the moment it is the only loader class available.

API

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

loader.js
return Loaders.Base.extend({
    customLoad: function () {
        this.customResources['loader.css']();
    },
});
  • No labels