dojox/grid/enhanced/_Events.js

  • Provides:

    • dojox.grid.enhanced._Events
  • dojox.grid.enhanced._Events

    • type
      Function
    • summary
      Overwrite some default events of DataGrid
    • description
      Methods are copied or replaced for overwriting, this might be refined once
      an overall plugin architecture is set up for DataGrid.
    • parameters:
      • inGrid: (typeof )
    • source: [view]
      dojo.provide("dojox.grid.enhanced._Events");


      dojo.declare("dojox.grid.enhanced._Events", null, {
       // summary:
       //  Overwrite some default events of DataGrid
       //
       // description:
       //  Methods are copied or replaced for overwriting, this might be refined once
       //  an overall plugin architecture is set up for DataGrid.


       //_events: Object
       //  Method map cached from dojox.grid._Events().
       _events: null,


       // headerCellActiveClass: String
       //  css class to apply to grid header cells when activated(mouse down)
       headerCellActiveClass: 'dojoxGridHeaderActive',

       
       // cellActiveClass: String
       //  css class to apply to grid content cells when activated(mouse down)
       cellActiveClass: 'dojoxGridCellActive',

       
       // rowActiveClass: String
       //  css class to apply to grid rows when activated(mouse down)
       rowActiveClass: 'dojoxGridRowActive',


       constructor: function(inGrid){
        //get the default Grid events
        this._events = new dojox.grid._Events();
        //for methods that won't be overwritten, copy them to "this" scope
        for(var p in this._events){
         if(!this[p]){
          this.p = this._events.p;
         }
        }
        //mixin "this" to Grid
        inGrid.mixin(inGrid, this);
  • dojox.grid.enhanced._Events._events

    • type
      Object
    • summary
      Method map cached from dojox.grid._Events().
  • dojox.grid.enhanced._Events.headerCellActiveClass

    • type
      String
    • summary
      css class to apply to grid header cells when activated(mouse down)
  • dojox.grid.enhanced._Events.cellActiveClass

    • type
      String
    • summary
      css class to apply to grid content cells when activated(mouse down)
  • dojox.grid.enhanced._Events.rowActiveClass

    • type
      String
    • summary
      css class to apply to grid rows when activated(mouse down)
  • dojox.grid.enhanced._Events.dokeyup

    • type
      Function
    • parameters:
      • e: (typeof Event)
        Un-decorated event object
    • source: [view]
        this.focus.currentArea().keyup(e);
    • summary
      Grid key up event handler.
  • dojox.grid.enhanced._Events.onKeyDown

    • type
      Function
    • parameters:
      • e: (typeof )
    • source: [view]
        if(e.altKey || e.metaKey){ return; }
        var dk = dojo.keys;
        var focus = this.focus;
        switch(e.keyCode){
         case dk.TAB:
          if(e.ctrlKey){ return; }
          focus.tab(e.shiftKey ? -1:1,e);
          break;
         case dk.UP_ARROW:
         case dk.DOWN_ARROW:
          focus.currentArea().move(e.keyCode == dk.UP_ARROW ? -1 : 1, 0, e);
          break;
         case dk.LEFT_ARROW:
         case dk.RIGHT_ARROW:
          var offset = (e.keyCode == dk.LEFT_ARROW) ? 1 : -1;
          if(dojo._isBodyLtr()){ offset *= -1; }
          focus.currentArea().move(0, offset, e);
          break;
         case dk.F10:
          if(this.menus && e.shiftKey){
           this.onRowContextMenu(e);
          }
          break;
         default:
          focus.currentArea().keydown(e);
          break;
        }
    • summary
      Overwritten, see dojox.grid._Events.onKeyDown();
  • dojox.grid.enhanced._Events.domouseup

    • type
      Function
    • parameters:
      • e: (typeof )
    • source: [view]
        if(e.cellNode){
         this.onMouseUp(e);
        }else{
         this.onRowSelectorMouseUp(e);
        }
    • summary
  • dojox.grid.enhanced._Events.domousedown

    • type
      Function
    • parameters:
      • e: (typeof )
    • source: [view]
        if(!e.cellNode){
         this.onRowSelectorMouseDown(e);
        }
    • summary
  • dojox.grid.enhanced._Events.onMouseUp

    • type
      Function
    • parameters:
      • e: (typeof Event)
        Decorated event object that contains reference to grid, cell, and rowIndex
    • source: [view]
        this[e.rowIndex == -1 ? "onHeaderCellMouseUp" : "onCellMouseUp"](e);
    • summary
      New - Event fired when mouse is up inside grid.
  • dojox.grid.enhanced._Events.onCellMouseDown

    • type
      Function
    • parameters:
      • e: (typeof )
    • source: [view]
        dojo.addClass(e.cellNode, this.cellActiveClass);
        dojo.addClass(e.rowNode, this.rowActiveClass);
    • summary
      Overwritten, see dojox.grid._Events.onCellMouseDown()
  • dojox.grid.enhanced._Events.onCellMouseUp

    • type
      Function
    • parameters:
      • e: (typeof Event)
        Decorated event object that contains reference to grid, cell, and rowIndex
    • source: [view]
        dojo.removeClass(e.cellNode, this.cellActiveClass);
        dojo.removeClass(e.rowNode, this.rowActiveClass);
    • summary
      New - Event fired when mouse is up inside content cell.
  • dojox.grid.enhanced._Events.onCellClick

    • type
      Function
    • parameters:
      • e: (typeof )
    • source: [view]
      dojo.provide("dojox.grid.enhanced._Events");


      dojo.declare("dojox.grid.enhanced._Events", null, {
       // summary:
       //  Overwrite some default events of DataGrid
       //
       // description:
       //  Methods are copied or replaced for overwriting, this might be refined once
       //  an overall plugin architecture is set up for DataGrid.


       //_events: Object
       //  Method map cached from dojox.grid._Events().
       _events: null,


       // headerCellActiveClass: String
       //  css class to apply to grid header cells when activated(mouse down)
       headerCellActiveClass: 'dojoxGridHeaderActive',

       
       // cellActiveClass: String
       //  css class to apply to grid content cells when activated(mouse down)
       cellActiveClass: 'dojoxGridCellActive',

       
       // rowActiveClass: String
       //  css class to apply to grid rows when activated(mouse down)
       rowActiveClass: 'dojoxGridRowActive',


       constructor: function(inGrid){
        //get the default Grid events
        this._events = new dojox.grid._Events();
        //for methods that won't be overwritten, copy them to "this" scope
        for(var p in this._events){
         if(!this[p]){
          this.p = this._events.p;
         }
        }
        //mixin "this" to Grid
        inGrid.mixin(inGrid, this);
       },
       dokeyup: function(e){
        // summary:
        //  Grid key up event handler.
        // e: Event
        //  Un-decorated event object
        this.focus.currentArea().keyup(e);
       },
       onKeyDown: function(e){
        // summary:
        //  Overwritten, see dojox.grid._Events.onKeyDown();
        if(e.altKey || e.metaKey){ return; }
        var dk = dojo.keys;
        var focus = this.focus;
        switch(e.keyCode){
         case dk.TAB:
          if(e.ctrlKey){ return; }
          focus.tab(e.shiftKey ? -1:1,e);
          break;
         case dk.UP_ARROW:
         case dk.DOWN_ARROW:
          focus.currentArea().move(e.keyCode == dk.UP_ARROW ? -1 : 1, 0, e);
          break;
         case dk.LEFT_ARROW:
         case dk.RIGHT_ARROW:
          var offset = (e.keyCode == dk.LEFT_ARROW) ? 1 : -1;
          if(dojo._isBodyLtr()){ offset *= -1; }
          focus.currentArea().move(0, offset, e);
          break;
         case dk.F10:
          if(this.menus && e.shiftKey){
           this.onRowContextMenu(e);
          }
          break;
         default:
          focus.currentArea().keydown(e);
          break;
        }
       },
       //TODO - make the following events more reasonalble - e.g. more accurate conditions
       //events for row selectors
       domouseup: function(e){
        if(e.cellNode){
         this.onMouseUp(e);
        }else{
         this.onRowSelectorMouseUp(e);
        }
       },
       domousedown: function(e){
        if(!e.cellNode){
         this.onRowSelectorMouseDown(e);
        }
       },
       onMouseUp: function(e){
        // summary:
        //  New - Event fired when mouse is up inside grid.
        // e: Event
        //  Decorated event object that contains reference to grid, cell, and rowIndex
        this[e.rowIndex == -1 ? "onHeaderCellMouseUp" : "onCellMouseUp"](e);
       },
       onCellMouseDown: function(e){
        // summary:
        //  Overwritten, see dojox.grid._Events.onCellMouseDown()
        dojo.addClass(e.cellNode, this.cellActiveClass);
        dojo.addClass(e.rowNode, this.rowActiveClass);
       },
       onCellMouseUp: function(e){
        // summary:
        //  New - Event fired when mouse is up inside content cell.
        // e: Event
        //  Decorated event object that contains reference to grid, cell, and rowIndex
        dojo.removeClass(e.cellNode, this.cellActiveClass);
        dojo.removeClass(e.rowNode, this.rowActiveClass);
       },
       onCellClick: function(e){
        // summary:
        //  Overwritten, see dojox.grid._Events.onCellClick()


        //invoke dojox.grid._Events.onCellClick()
        this._events.onCellClick.call(this, e);
        //move mouse events to the focus manager.
        this.focus.contentMouseEvent(e);//TODO
    • chains:
      • this._events.onCellClick: (call)
    • summary
  • dojox.grid.enhanced._Events.onCellDblClick

    • type
      Function
    • parameters:
      • e: (typeof )
    • source: [view]
        if(this.pluginMgr.isFixedCell(e.cell)){ return; }
        if(this._click.length > 1 && (!this._click[0] || !this._click[1])){
         this._click[0] = this._click[1] = e;
        }
        //invoke dojox.grid._Events.onCellDblClick()
        this._events.onCellDblClick.call(this, e);
        //now focus.setFocusCell need isEditing info, so call it after that is set.
        //this.focus.setFocusCell(e.cell, e.rowIndex);
    • summary
      Overwritten, see dojox.grid._Events.onCellDblClick()
    • chains:
      • this._events.onCellDblClick: (call)
  • dojox.grid.enhanced._Events.onRowClick

    • type
      Function
    • parameters:
      • e: (typeof )
    • source: [view]
        this.edit.rowClick(e);
        if(!e.cell || (!e.cell.isRowSelector && (!this.rowSelectCell || !this.rowSelectCell.disabled(e.rowIndex)))){
         this.selection.clickSelectEvent(e);
        }
    • summary
      Overwritten, see dojox.grid._Events.onRowClick()
  • dojox.grid.enhanced._Events.onRowContextMenu

    • type
      Function
    • parameters:
      • e: (typeof )
    • source: [view]
        if(!this.edit.isEditing() && this.menus){
         this.showMenu(e);
        }
    • summary
      Overwritten, see dojox.grid._Events.onRowContextMenu()
  • dojox.grid.enhanced._Events.onSelectedRegionContextMenu

    • type
      Function
    • parameters:
      • e: (typeof Event)
        Decorated event object which contains reference to grid and info of selected
        regions(selection type - row|column, selected index - [...])
    • source: [view]
        if(this.selectedRegionMenu){
         this.selectedRegionMenu._openMyself({
          target: e.target,
          coords: e.keyCode !== dojo.keys.F10 && "pageX" in e ? {
           x: e.pageX,
           y: e.pageY
          } : null
         });
         dojo.stopEvent(e);
        }
    • summary
      New - Event fired when a selected region context menu is accessed via mouse right click.
  • dojox.grid.enhanced._Events.onHeaderCellMouseOut

    • type
      Function
    • parameters:
      • e: (typeof )
    • source: [view]
        if(e.cellNode){
         dojo.removeClass(e.cellNode, this.cellOverClass);
         dojo.removeClass(e.cellNode, this.headerCellActiveClass);
        }
    • summary
      Overwritten, see dojox.grid._Events.onHeaderCellMouseOut()
  • dojox.grid.enhanced._Events.onHeaderCellMouseDown

    • type
      Function
    • parameters:
      • e: (typeof )
    • source: [view]
        if(e.cellNode){//TBD - apply to selection region for nested sorting?
         dojo.addClass(e.cellNode, this.headerCellActiveClass);
        }
    • summary
      Overwritten, see dojox.grid._Events.onHeaderCellMouseDown()
  • dojox.grid.enhanced._Events.onHeaderCellMouseUp

    • type
      Function
    • parameters:
      • e: (typeof )
    • source: [view]
        if(e.cellNode){
         dojo.removeClass(e.cellNode, this.headerCellActiveClass);
        }
    • summary
      New event
  • dojox.grid.enhanced._Events.onHeaderCellClick

    • type
      Function
    • parameters:
      • e: (typeof )
    • source: [view]
        this.focus.currentArea("header");
        //invoke dojox.grid._Events.onHeaderCellClick()
        if(!e.cell.isRowSelector){
         this._events.onHeaderCellClick.call(this, e);
        }
        //move mouse events to the focus manager.
        this.focus.headerMouseEvent(e);
    • summary
      Overwritten, see dojox.grid._Events.onHeaderCellClick()
      move focus to header.
    • chains:
      • this._events.onHeaderCellClick: (call)
  • dojox.grid.enhanced._Events.onRowSelectorMouseDown

    • type
      Function
    • parameters:
      • e: (typeof )
    • source: [view]
        this.focus.focusArea("rowHeader", e);
    • summary
  • dojox.grid.enhanced._Events.onRowSelectorMouseUp

    • type
      Function
    • parameters:
      • e: (typeof )
    • source: [view]
      }
    • summary
  • dojox.grid.enhanced._Events.onMouseUpRow

    • type
      Function
    • parameters:
      • e: (typeof )
    • source: [view]
        if(e.rowIndex != -1){
         this.onRowMouseUp(e);
        }
    • summary
  • dojox.grid.enhanced._Events.onRowMouseUp

    • type
      Function
    • parameters:
      • e: (typeof )
    • source: [view]
      }
    • summary
  • dojox.grid.enhanced._Events.p

    • summary
  • dojox.grid.enhanced

    • type
      Object
    • summary
  • dojox.grid

    • type
      Object
    • summary
  • dojox

    • type
      Object
    • summary