Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/brosenberger/jquery-dashboard

This repository contains a easy to use and extendable dashboard framework written in javascript to be embedded within existing web applications
https://github.com/brosenberger/jquery-dashboard

dashboard-widget dashboards javascript javascript-library jquery jquery-ui widgets

Last synced: 22 days ago
JSON representation

This repository contains a easy to use and extendable dashboard framework written in javascript to be embedded within existing web applications

Awesome Lists containing this project

README

        

# jquery-dashboard

Demo: see https://brosenberger.github.io/jquery-dashboard/docs/index.html

This library provides a framework for showing a Jira-Like Dashboard and easy creating Widgets.

**Usage**

Install via npm:
```js
npm install jquery-dashboard --save
```

As library embedd dependencies (e.g. with cdn links):

```html

```

and dashboard components (styles not yet included, see docs/index.html for inline styling):

```html

```

initialize components:

```js
$(document).ready(function () {
// initialize dashboard services
var service = Dashboard.core.default();
// register sample widgets
Dashboard.samples.default(service);

// create dashboard view and refresh list
var dashboard = $('.dashboard-sortable').dashboard({
dashboardService: service
}).dashboard("refresh");
// initialize widget add dialog
$('h1 .fa.fa-plus-square').dashboardWidgetDialog({
dashboardService: service,
addCallback: function(widgetData) {
dashboard.dashboard("addWidget", widgetData);
}
});

});
```

**Creating your own Widgets**

This is possible with standard require/extension mechanism like within the sample, but also without all js environment.

e.g. a Welcome Widget, just showing some welcome message:

```js
var WelcomeWidget = function () {
this.type = WelcomeWidget.type;
this.widgetTemplate= Dashboard.widgetWelcome;
this.sizeConfiguration= 'col-xs-12 col-md-6';
};
WelcomeWidget.type = 'welcomeWidget';
WelcomeWidget.prototype = $.extend(Dashboard.core.Widget.prototype, {
description: {
title: 'Welcome Widget',
description: 'Gives you a warm welcome'
},
initialize: function (widgetElement) {
console.log('welcome widget initialized');
}
});
```

Handlebarlayouts have to initialized when embedding as library:
```js
handlebarsLayouts.register(Handlebars);
Handlebars.registerPartial('widget-layout', Dashboard.templates.layout);
Handlebars.registerPartial('widget-configuration-layout', Dashboard.templates.configurationLayout);
```

Register the widget within the service:
```js
dashboardService.registerWidget(new WelcomeWidget());
```