-
Notifications
You must be signed in to change notification settings - Fork 0
/
RockGridPlugin.js
36 lines (32 loc) · 1.01 KB
/
RockGridPlugin.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
/* base class */
var RockGridPlugin = function() {
// the plugin's name
this.name = 'RockGridPlugin';
// plugins are enabled by default
this.enabled = true;
this.isEnabled = function() {
// if the plugin is enabled/disabled for this grid we return this value
// otherwise we return the default state of the plugin
var plugin = this.grid.plugins[this.name];
if(typeof plugin == typeof undefined) return this.enabled;
return plugin.enabled;
}
// get settings for this plugin
this.getSettings = function() {
var plugin = this.grid.plugins[this.name];
if(typeof plugin == typeof undefined) return {};
return plugin.settings;
}
// set settings for this plugin
this.setSettings = function(params) {
for(setting in params) {
this.settings[setting] = params[setting];
}
}
};
/**
* event callbacks for a plugin
*/
RockGridPlugin.prototype.onLoad = function() {};
RockGridPlugin.prototype.onDomReady = function() {};
RockGridPlugin.prototype.onAjaxDone = function() {};