Function
Base class for all plugins.
Provides common plugin functionality and basic life cycle management. Each concrete plugin must have a name field and is responsible for registering itself to the global plugin registry e.g. for dnd plugin: dojox.grid.EnhancedGrid.registerPlugin("dnd" /*plugin name*/, dojox.grid.enhanced.plugins.DnD /*full class name of a plugin*/ {"preInit": false, "dependency": ["nestedSorting"]} /*properties*/); [Keywords] of plugin properties(case sensitive) - "preInit": boolean, whether a plugin should be created before EnhancedGrid.postCreate(), false by default(plugins are created after EnhancedGrid.postCreate()). - "dependency": array or string, plugin(s) indicated by "dependency" will be created before the current one. Note: recursive cycle dependencies are not supported e.g. following dependency is invalid: pluginA -> pluginB -> pluginA
1. Customize default DnD plugin dojo.declare("mygrid.MyDnD", dojox.grid.enhanced.plugins.DnD, { name:"dnd" //still reuse the plugin name constructor: function(inGrid, option){ ... } }); dojox.grid.EnhancedGrid.registerPlugin("dnd", mygrid.MyDnD); 2. Add new plugin - PluginA dojo.declare("mygrid.PluginA", dojox.grid.enhanced._Plugin, { name: "pA", constructor: function(inGrid, option){ ... } }); dojox.grid.EnhancedGrid.registerPlugin("pA",mygrid.PluginA); 3. Use plugins dojo.require("mygrid.MyDnD"); dojo.require("mygrid.PluginA"); <script type="text/javascript"> var grid = new dojox.grid.EnhancedGrid( {plugins: {dnd:true, pA:true}, ... }, dojo.byId("gridDiv")); grid.startup(); </script>
String
Plugin name, e.g. 'nestedSorting', 'dnd'...
Object
Grid that the plugin belongs to
Object
Array
List of all connections.
Array
List of all subscribes.
Object
Function
Function
Function
Function
Function
Connects specified obj/event to specified method of this object.
var plugin = new dojox.grid.enhanced._Plugin(grid,"myPlugin",{...}); // when foo.bar() is called, call the listener in the scope of plugin plugin.connect(foo, "bar", function(){ console.debug(this.xxx());//"this" - plugin scope });
Function
Disconnects handle and removes it from connection list.
Function
Subscribes to the specified topic and calls the specified method of this object.
var plugin = new dojox.grid.enhanced._Plugin(grid,"myPlugin",{...}); // when /my/topic is published, call the subscriber in the scope of plugin // with passed parameter - "v" plugin.subscribe("/my/topic", function(v){ console.debug(this.xxx(v));//"this" - plugin scope });
Function
Un-subscribes handle and removes it from subscriptions list.
Function
Called when store is changed.
Function
Destroy all resources.
Object
Object
Object