dojox/grid/_Events.js

  • Provides:

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

    • type
      Function
    • summary
      _Grid mixin that provides default implementations for grid events.
    • description
      Default synthetic events dispatched for _Grid. dojo.connect to events to
      retain default implementation or override them for custom handling.
  • dojox.grid._Events.cellOverClass

    • type
      String
    • summary
      css class to apply to grid cells over which the cursor is placed.
  • dojox.grid._Events.onKeyEvent

    • type
      Function
    • parameters:
      • e: (typeof )
    • source: [view]
        this.dispatchKeyEvent(e);
    • summary
      top level handler for Key Events
  • dojox.grid._Events.onContentEvent

    • type
      Function
    • parameters:
      • e: (typeof )
    • source: [view]
        this.dispatchContentEvent(e);
    • summary
      Top level handler for Content events
  • dojox.grid._Events.onHeaderEvent

    • type
      Function
    • parameters:
      • e: (typeof )
    • source: [view]
        this.dispatchHeaderEvent(e);
    • summary
      Top level handler for header events
  • dojox.grid._Events.onStyleRow

    • type
      Function
    • parameters:
      • inRow: (typeof Object)
        Object containing row state information: selected, true if the row is selcted; over:
        true of the mouse is over the row; odd: true if the row is odd. Use customClasses and
        customStyles to control row css classes and styles; both properties are strings.
    • source: [view]
        var i = inRow;
        i.customClasses += (i.odd?" dojoxGridRowOdd":"") + (i.selected?" dojoxGridRowSelected":"") + (i.over?" dojoxGridRowOver":"");
        this.focus.styleRow(inRow);
        this.edit.styleRow(inRow);
    • summary
      Perform row styling on a given row. Called whenever row styling is updated.
    • example
      onStyleRow({ selected: true, over:true, odd:false })
  • dojox.grid._Events.onKeyDown

    • type
      Function
    • parameters:
      • e: (typeof )
    • source: [view]
        if(e.altKey || e.metaKey){
         return;
        }
        var dk = dojo.keys;
        var colIdx;
        switch(e.keyCode){
         case dk.ESCAPE:
          this.edit.cancel();
          break;
         case dk.ENTER:
          if(!this.edit.isEditing()){
           colIdx = this.focus.getHeaderIndex();
           if(colIdx >= 0) {
            this.setSortIndex(colIdx);
            break;
           }else {
            this.selection.clickSelect(this.focus.rowIndex, dojo.isCopyKey(e), e.shiftKey);
           }
           dojo.stopEvent(e);
          }
          if(!e.shiftKey){
           var isEditing = this.edit.isEditing();
           this.edit.apply();
           if(!isEditing){
            this.edit.setEditCell(this.focus.cell, this.focus.rowIndex);
           }
          }
          if (!this.edit.isEditing()){
           var curView = this.focus.focusView || this.views.views[0]; //if no focusView than only one view
           curView.content.decorateEvent(e);
           this.onRowClick(e);
           dojo.stopEvent(e);
          }
          break;
         case dk.SPACE:
          if(!this.edit.isEditing()){
           colIdx = this.focus.getHeaderIndex();
           if(colIdx >= 0) {
            this.setSortIndex(colIdx);
            break;
           }else {
            this.selection.clickSelect(this.focus.rowIndex, dojo.isCopyKey(e), e.shiftKey);
           }
           dojo.stopEvent(e);
          }
          break;
         case dk.TAB:
          this.focus[e.shiftKey ? 'previousKey' : 'nextKey'](e);
          break;
         case dk.LEFT_ARROW:
         case dk.RIGHT_ARROW:
          if(!this.edit.isEditing()){
           var keyCode = e.keyCode; // IE seems to lose after stopEvent when modifier keys
           dojo.stopEvent(e);
           colIdx = this.focus.getHeaderIndex();
           if (colIdx >= 0 && (e.shiftKey && e.ctrlKey)){
            this.focus.colSizeAdjust(e, colIdx, (keyCode == dk.LEFT_ARROW ? -1 : 1)*5);
           }
           else{
            var offset = (keyCode == dk.LEFT_ARROW) ? 1 : -1;
            if(dojo._isBodyLtr()){ offset *= -1; }
            this.focus.move(0, offset);
           }
          }
          break;
         case dk.UP_ARROW:
          if(!this.edit.isEditing() && this.focus.rowIndex !== 0){
           dojo.stopEvent(e);
           this.focus.move(-1, 0);
          }
          break;
         case dk.DOWN_ARROW:
          if(!this.edit.isEditing() && this.focus.rowIndex+1 != this.rowCount){
           dojo.stopEvent(e);
           this.focus.move(1, 0);
          }
          break;
         case dk.PAGE_UP:
          if(!this.edit.isEditing() && this.focus.rowIndex !== 0){
           dojo.stopEvent(e);
           if(this.focus.rowIndex != this.scroller.firstVisibleRow+1){
            this.focus.move(this.scroller.firstVisibleRow-this.focus.rowIndex, 0);
           }else{
            this.setScrollTop(this.scroller.findScrollTop(this.focus.rowIndex-1));
            this.focus.move(this.scroller.firstVisibleRow-this.scroller.lastVisibleRow+1, 0);
           }
          }
          break;
         case dk.PAGE_DOWN:
          if(!this.edit.isEditing() && this.focus.rowIndex+1 != this.rowCount){
           dojo.stopEvent(e);
           if(this.focus.rowIndex != this.scroller.lastVisibleRow-1){
            this.focus.move(this.scroller.lastVisibleRow-this.focus.rowIndex-1, 0);
           }else{
            this.setScrollTop(this.scroller.findScrollTop(this.focus.rowIndex+1));
            this.focus.move(this.scroller.lastVisibleRow-this.scroller.firstVisibleRow-1, 0);
           }
          }
          break;
         default:
          break;
        }
    • summary
      Grid key event handler. By default enter begins editing and applies edits, escape cancels an edit,
      tab, shift-tab, and arrow keys move grid cell focus.
    • chains:
      • this.edit: (call)
  • dojox.grid._Events.onMouseOver

    • type
      Function
    • parameters:
      • e: (typeof Event)
        Decorated event object contains reference to grid, cell, and rowIndex
    • source: [view]
        e.rowIndex == -1 ? this.onHeaderCellMouseOver(e) : this.onCellMouseOver(e);
    • summary
      Event fired when mouse is over the grid.
  • dojox.grid._Events.onMouseOut

    • type
      Function
    • parameters:
      • e: (typeof Event)
        Decorated event object that contains reference to grid, cell, and rowIndex
    • source: [view]
        e.rowIndex == -1 ? this.onHeaderCellMouseOut(e) : this.onCellMouseOut(e);
    • summary
      Event fired when mouse moves out of the grid.
  • dojox.grid._Events.onMouseDown

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

    • type
      Function
    • parameters:
      • e: (typeof Event)
        Decorated event object contains reference to grid, cell, and rowIndex
    • source: [view]
        if(!this.rows.isOver(e.rowIndex)){
         this.rows.setOverRow(e.rowIndex);
         e.rowIndex == -1 ? this.onHeaderMouseOver(e) : this.onRowMouseOver(e);
        }
    • summary
      Event fired when mouse is over any row (data or header).
  • dojox.grid._Events.onMouseOutRow

    • type
      Function
    • parameters:
      • e: (typeof Event)
        Decorated event object contains reference to grid, cell, and rowIndex
    • source: [view]
        if(this.rows.isOver(-1)){
         this.onHeaderMouseOut(e);
        }else if(!this.rows.isOver(-2)){
         this.rows.setOverRow(-2);
         this.onRowMouseOut(e);
        }
    • summary
      Event fired when mouse moves out of any row (data or header).
  • dojox.grid._Events.onMouseDownRow

    • type
      Function
    • parameters:
      • e: (typeof Event)
        Decorated event object that contains reference to grid, cell, and rowIndex
    • source: [view]
        if(e.rowIndex != -1)
         this.onRowMouseDown(e);
    • summary
      Event fired when mouse is down inside grid row
  • dojox.grid._Events.onCellMouseOver

    • type
      Function
    • parameters:
      • e: (typeof Event)
        Decorated event object contains reference to grid, cell, and rowIndex
    • source: [view]
        if(e.cellNode){
         dojo.addClass(e.cellNode, this.cellOverClass);
        }
    • summary
      Event fired when mouse is over a cell.
  • dojox.grid._Events.onCellMouseOut

    • type
      Function
    • parameters:
      • e: (typeof Event)
        Decorated event object which contains reference to grid, cell, and rowIndex
    • source: [view]
        if(e.cellNode){
         dojo.removeClass(e.cellNode, this.cellOverClass);
        }
    • summary
      Event fired when mouse moves out of a cell.
  • dojox.grid._Events.onCellMouseDown

    • type
      Function
    • parameters:
      • e: (typeof Event)
        Decorated event object which contains reference to grid, cell, and rowIndex
    • source: [view]
        // summary:
        //  Event fired when mouse is down in a header cell.
        // e: Event
        //   Decorated event object which contains reference to grid, cell, and rowIndex
    • summary
      Event fired when mouse is down in a header cell.
  • dojox.grid._Events.onCellClick

    • type
      Function
    • parameters:
      • e: (typeof Event)
        Decorated event object which contains reference to grid, cell, and rowIndex
    • source: [view]
        this._click[0] = this._click[1];
        this._click[1] = e;
        if(!this.edit.isEditCell(e.rowIndex, e.cellIndex)){
         this.focus.setFocusCell(e.cell, e.rowIndex);
        }
        this.onRowClick(e);
    • summary
      Event fired when a cell is clicked.
  • dojox.grid._Events.onCellDblClick

    • type
      Function
    • parameters:
      • e: (typeof Event)
        Decorated event object contains reference to grid, cell, and rowIndex
    • source: [view]
        if(this._click.length > 1 && dojo.isIE){
         this.edit.setEditCell(this._click[1].cell, this._click[1].rowIndex);
        }else if(this._click.length > 1 && this._click[0].rowIndex != this._click[1].rowIndex){
         this.edit.setEditCell(this._click[0].cell, this._click[0].rowIndex);
        }else{
         this.edit.setEditCell(e.cell, e.rowIndex);
        }
        this.onRowDblClick(e);
    • summary
      Event fired when a cell is double-clicked.
  • dojox.grid._Events.onCellContextMenu

    • type
      Function
    • parameters:
      • e: (typeof Event)
        Decorated event object which contains reference to grid, cell, and rowIndex
    • source: [view]
        this.onRowContextMenu(e);
    • summary
      Event fired when a cell context menu is accessed via mouse right click.
  • dojox.grid._Events.onCellFocus

    • type
      Function
    • parameters:
      • inCell: (typeof Object)
        Cell object containing properties of the grid column.
      • inRowIndex: (typeof Integer)
        Index of the grid row
    • source: [view]
        this.edit.cellFocus(inCell, inRowIndex);
    • summary
      Event fired when a cell receives focus.
  • dojox.grid._Events.onRowClick

    • type
      Function
    • parameters:
      • e: (typeof Event)
        Decorated event object which contains reference to grid, cell, and rowIndex
    • source: [view]
        this.edit.rowClick(e);
        this.selection.clickSelectEvent(e);
    • summary
      Event fired when a row is clicked.
  • dojox.grid._Events.onRowDblClick

    • type
      Function
    • parameters:
      • e: (typeof Event)
        decorated event object which contains reference to grid, cell, and rowIndex
    • source: [view]
        // summary:
        //  Event fired when a row is double clicked.
        // e: Event
        //  decorated event object which contains reference to grid, cell, and rowIndex
    • summary
      Event fired when a row is double clicked.
  • dojox.grid._Events.onRowMouseOver

    • type
      Function
    • parameters:
      • e: (typeof Event)
        Decorated event object which contains reference to grid, cell, and rowIndex
    • source: [view]
        // summary:
        //  Event fired when mouse moves over a data row.
        // e: Event
        //  Decorated event object which contains reference to grid, cell, and rowIndex
    • summary
      Event fired when mouse moves over a data row.
  • dojox.grid._Events.onRowMouseOut

    • type
      Function
    • parameters:
      • e: (typeof Event)
        Decorated event object contains reference to grid, cell, and rowIndex
    • source: [view]
        // summary:
        //  Event fired when mouse moves out of a data row.
        // e: Event
        //   Decorated event object contains reference to grid, cell, and rowIndex
    • summary
      Event fired when mouse moves out of a data row.
  • dojox.grid._Events.onRowMouseDown

    • type
      Function
    • parameters:
      • e: (typeof Event)
        Decorated event object which contains reference to grid, cell, and rowIndex
    • source: [view]
        // summary:
        //  Event fired when mouse is down in a row.
        // e: Event
        //   Decorated event object which contains reference to grid, cell, and rowIndex
    • summary
      Event fired when mouse is down in a row.
  • dojox.grid._Events.onRowContextMenu

    • type
      Function
    • parameters:
      • e: (typeof Event)
        Decorated event object which contains reference to grid, cell, and rowIndex
    • source: [view]
        dojo.stopEvent(e);
    • summary
      Event fired when a row context menu is accessed via mouse right click.
  • dojox.grid._Events.onHeaderMouseOver

    • type
      Function
    • parameters:
      • e: (typeof Event)
        Decorated event object contains reference to grid, cell, and rowIndex
    • source: [view]
        // summary:
        //  Event fired when mouse moves over the grid header.
        // e: Event
        //   Decorated event object contains reference to grid, cell, and rowIndex
    • summary
      Event fired when mouse moves over the grid header.
  • dojox.grid._Events.onHeaderMouseOut

    • type
      Function
    • parameters:
      • e: (typeof Event)
        Decorated event object which contains reference to grid, cell, and rowIndex
    • source: [view]
        // summary:
        //  Event fired when mouse moves out of the grid header.
        // e: Event
        //   Decorated event object which contains reference to grid, cell, and rowIndex
    • summary
      Event fired when mouse moves out of the grid header.
  • dojox.grid._Events.onHeaderCellMouseOver

    • type
      Function
    • parameters:
      • e: (typeof Event)
        Decorated event object which contains reference to grid, cell, and rowIndex
    • source: [view]
        if(e.cellNode){
         dojo.addClass(e.cellNode, this.cellOverClass);
        }
    • summary
      Event fired when mouse moves over a header cell.
  • dojox.grid._Events.onHeaderCellMouseOut

    • type
      Function
    • parameters:
      • e: (typeof Event)
        Decorated event object which contains reference to grid, cell, and rowIndex
    • source: [view]
        if(e.cellNode){
         dojo.removeClass(e.cellNode, this.cellOverClass);
        }
    • summary
      Event fired when mouse moves out of a header cell.
  • dojox.grid._Events.onHeaderCellMouseDown

    • type
      Function
    • parameters:
      • e: (typeof Event)
        Decorated event object which contains reference to grid, cell, and rowIndex
    • source: [view]
        // summary:
        //  Event fired when mouse is down in a header cell.
        // e: Event
        //   Decorated event object which contains reference to grid, cell, and rowIndex
    • summary
      Event fired when mouse is down in a header cell.
  • dojox.grid._Events.onHeaderClick

    • type
      Function
    • parameters:
      • e: (typeof Event)
        Decorated event object which contains reference to grid, cell, and rowIndex
    • source: [view]
        // summary:
        //  Event fired when the grid header is clicked.
        // e: Event
        // Decorated event object which contains reference to grid, cell, and rowIndex
    • summary
      Event fired when the grid header is clicked.
  • dojox.grid._Events.onHeaderCellClick

    • type
      Function
    • parameters:
      • e: (typeof Event)
        Decorated event object which contains reference to grid, cell, and rowIndex
    • source: [view]
        this.setSortIndex(e.cell.index);
        this.onHeaderClick(e);
    • summary
      Event fired when a header cell is clicked.
  • dojox.grid._Events.onHeaderDblClick

    • type
      Function
    • parameters:
      • e: (typeof Event)
        Decorated event object which contains reference to grid, cell, and rowIndex
    • source: [view]
        // summary:
        //  Event fired when the grid header is double clicked.
        // e: Event
        //  Decorated event object which contains reference to grid, cell, and rowIndex
    • summary
      Event fired when the grid header is double clicked.
  • dojox.grid._Events.onHeaderCellDblClick

    • type
      Function
    • parameters:
      • e: (typeof Event)
        Decorated event object which contains reference to grid, cell, and rowIndex
    • source: [view]
        this.onHeaderDblClick(e);
    • summary
      Event fired when a header cell is double clicked.
  • dojox.grid._Events.onHeaderCellContextMenu

    • type
      Function
    • parameters:
      • e: (typeof Event)
        Decorated event object which contains reference to grid, cell, and rowIndex
    • source: [view]
        this.onHeaderContextMenu(e);
    • summary
      Event fired when a header cell context menu is accessed via mouse right click.
  • dojox.grid._Events.onHeaderContextMenu

    • type
      Function
    • parameters:
      • e: (typeof Event)
        Decorated event object which contains reference to grid, cell, and rowIndex
    • source: [view]
        if(!this.headerMenu){
         dojo.stopEvent(e);
        }
    • summary
      Event fired when the grid header context menu is accessed via mouse right click.
  • dojox.grid._Events.onStartEdit

    • type
      Function
    • parameters:
      • inCell: (typeof Object)
        Cell object containing properties of the grid column.
      • inRowIndex: (typeof Integer)
        Index of the grid row
    • source: [view]
        // summary:
        //  Event fired when editing is started for a given grid cell
        // inCell: Object
        //  Cell object containing properties of the grid column.
        // inRowIndex: Integer
        //  Index of the grid row
    • summary
      Event fired when editing is started for a given grid cell
  • dojox.grid._Events.onApplyCellEdit

    • type
      Function
    • parameters:
      • inValue: (typeof String)
        Value from cell editor
      • inRowIndex: (typeof Integer)
        Index of the grid row
      • inFieldIndex: (typeof Integer)
        Index in the grid's data store
    • source: [view]
        // summary:
        //  Event fired when editing is applied for a given grid cell
        // inValue: String
        //  Value from cell editor
        // inRowIndex: Integer
        //  Index of the grid row
        // inFieldIndex: Integer
        //  Index in the grid's data store
    • summary
      Event fired when editing is applied for a given grid cell
  • dojox.grid._Events.onCancelEdit

    • type
      Function
    • parameters:
      • inRowIndex: (typeof Integer)
        Index of the grid row
    • source: [view]
        // summary:
        //  Event fired when editing is cancelled for a given grid cell
        // inRowIndex: Integer
        //  Index of the grid row
    • summary
      Event fired when editing is cancelled for a given grid cell
  • dojox.grid._Events.onApplyEdit

    • type
      Function
    • parameters:
      • inRowIndex: (typeof Integer)
        Index of the grid row
    • source: [view]
        // summary:
        //  Event fired when editing is applied for a given grid row
        // inRowIndex: Integer
        //  Index of the grid row
    • summary
      Event fired when editing is applied for a given grid row
  • dojox.grid._Events.onCanSelect

    • type
      Function
    • parameters:
      • inRowIndex: (typeof Integer)
        Index of the grid row
    • source: [view]
        return true;
    • summary
      Event to determine if a grid row may be selected
    • return_summary
      Boolean
      true if the row can be selected
  • dojox.grid._Events.onCanDeselect

    • type
      Function
    • parameters:
      • inRowIndex: (typeof Integer)
        Index of the grid row
    • source: [view]
        return true;
    • summary
      Event to determine if a grid row may be deselected
    • return_summary
      Boolean
      true if the row can be deselected
  • dojox.grid._Events.onSelected

    • type
      Function
    • parameters:
      • inRowIndex: (typeof Integer)
        Index of the grid row
    • source: [view]
        this.updateRowStyles(inRowIndex);
    • summary
      Event fired when a grid row is selected
  • dojox.grid._Events.onDeselected

    • type
      Function
    • parameters:
      • inRowIndex: (typeof Integer)
        Index of the grid row
    • source: [view]
        this.updateRowStyles(inRowIndex);
    • summary
      Event fired when a grid row is deselected
  • dojox.grid._Events.onSelectionChanged

    • type
      Function
    • source: [view]
    • summary
  • dojox.grid

    • type
      Object
    • summary
  • dojox

    • type
      Object
    • summary