Warning: Use of undefined constant Symbol - assumed 'Symbol' (this will throw an Error in a future version of PHP) in /mnt/new-ebs/workbench-106550/lib/dojo/util/docscripts/lib/parser2/dojo2.inc on line 215 Warning: Use of undefined constant JavaScriptSymbol - assumed 'JavaScriptSymbol' (this will throw an Error in a future version of PHP) in /mnt/new-ebs/workbench-106550/lib/dojo/util/docscripts/lib/parser2/dojo2.inc on line 215

dojox/grid/enhanced/_Plugin.js

  • Provides:

    • dojox.grid.enhanced._Plugin
  • Requires:

    • dojox.grid.EnhancedGrid in common
  • dojox.grid.enhanced._Plugin

    • type
      Function
    • parameters:
      • inGrid
      • option
    • summary
      Base class for all plugins.
    • description
      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
    • example
      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");
  • dojox.grid.enhanced._Plugin.name

    • type
      String
    • summary
      Plugin name, e.g. 'nestedSorting', 'dnd'...
  • dojox.grid.enhanced._Plugin.grid

    • type
      Object
    • summary
      Grid that the plugin belongs to
  • dojox.grid.enhanced._Plugin.option

    • type
      Object
    • summary
      Plugin properties - leveraged with default and user specified properties.
      e.g. for dnd plugin, it may look like {"class": dojox.grid.enhanced.plugins.DnD, "dependency": ["nestedSorting"], ...}
  • dojox.grid.enhanced._Plugin._connects

    • type
      Array
    • summary
      List of all connections.
  • dojox.grid.enhanced._Plugin._subscribes

    • type
      Array
    • summary
      List of all subscribes.
  • dojox.grid.enhanced._Plugin.privates

    • type
      Object
    • summary
      Private properties/methods shouldn't be mixin-ed anytime.
  • dojox.grid.enhanced._Plugin.constructor

    • constructor - constructor
    • type
      Function
    • parameters:
      • inGrid
      • option
  • dojox.grid.enhanced._Plugin.init

    • type
      Function
  • dojox.grid.enhanced._Plugin.onPreInit

    • type
      Function
  • dojox.grid.enhanced._Plugin.onPostInit

    • type
      Function
  • dojox.grid.enhanced._Plugin.onStartUp

    • type
      Function
  • dojox.grid.enhanced._Plugin.connect

    • parameters:
      • obj
      • event
      • method
    • summary
      Connects specified obj/event to specified method of this object.
    • example
      	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
      	});
    • type
      Function
  • dojox.grid.enhanced._Plugin.disconnect

    • parameters:
      • handle
    • summary
      Disconnects handle and removes it from connection list.
    • type
      Function
  • dojox.grid.enhanced._Plugin.subscribe

    • parameters:
      • topic
      • method
    • summary
      Subscribes to the specified topic and calls the specified method
      of this object.
    • example
      	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
      	});
    • type
      Function
  • dojox.grid.enhanced._Plugin.unsubscribe

    • parameters:
      • handle
    • summary
      Un-subscribes handle and removes it from subscriptions list.
    • type
      Function
  • dojox.grid.enhanced._Plugin.onSetStore

    • parameters:
      • store
    • summary
      Called when store is changed.
    • type
      Function
  • dojox.grid.enhanced._Plugin.destroy

    • summary
      Destroy all resources.
    • type
      Function
  • dojox.grid.enhanced

    • type
      Object
  • dojox.grid

    • type
      Object
  • dojox

    • type
      Object