dojox/grid/enhanced/plugins/IndirectSelection.js

  • Provides:

    • dojox.grid.enhanced.plugins.IndirectSelection
  • Requires:

    • dojo.string in common in project dojo
    • dojox.grid.cells.dijit in common
    • dojox.grid.enhanced._Plugin in common
  • dojox.grid.enhanced.plugins.IndirectSelection

    • type
      Function
    • chains:
      • dojox.grid.enhanced._Plugin: (prototype)
      • dojox.grid.enhanced._Plugin: (call)
    • summary
      A handy way for adding check boxe/radio button for rows, and selecting rows by swiping(or keyboard)
    • description
      For better rendering performance, div(images) are used to simulate radio button|check boxes
    • example
      <div dojoType="dojox.grid.EnhancedGrid" plugins="{indirectSelection: true}" ...></div>
      or <div dojoType="dojox.grid.EnhancedGrid" plugins="{indirectSelection: {name: 'xxx', width:'30px', styles:'text-align: center;'}}" ...></div>
    • source: [view]
      dojo.provide("dojox.grid.enhanced.plugins.IndirectSelection");


      dojo.require('dojo.string');
      dojo.require("dojox.grid.cells.dijit");
      dojo.require("dojox.grid.enhanced._Plugin");


      dojo.declare("dojox.grid.enhanced.plugins.IndirectSelection", dojox.grid.enhanced._Plugin, {
       // summary:
       //  A handy way for adding check boxe/radio button for rows, and selecting rows by swiping(or keyboard)


       // description:
       //  For better rendering performance, div(images) are used to simulate radio button|check boxes
       //
       // example:
       //  

       //  or



       //name: String
       //  Plugin name
       name: "indirectSelection",

       
       constructor: function(){
        //Hook layout.setStructure(), so that indirectSelection is always included
        var layout = this.grid.layout;
        this.connect(layout, 'setStructure', dojo.hitch(layout, this.addRowSelectCell, this.option));
  • dojox.grid.enhanced.plugins.IndirectSelection.name

    • type
      String
    • summary
      Plugin name
  • dojox.grid.enhanced.plugins.IndirectSelection.addRowSelectCell

    • type
      Function
    • parameters:
      • option: (typeof )
    • source: [view]
        if(!this.grid.indirectSelection || this.grid.selectionMode == 'none'){
         return;
        }
        var rowSelectCellAdded = false, inValidFields = ['get', 'formatter', 'field', 'fields'],
        defaultCellDef = {type: dojox.grid.cells.MultipleRowSelector, name: '', width:'30px', styles:'text-align: center;'};
        if(option.headerSelector){ option.name = ''; }//mutual conflicting attrs


        if(this.grid.rowSelectCell){//remove the existed one
         this.grid.rowSelectCell.destroy();
        }

        
        dojo.forEach(this.structure, function(view){
         var cells = view.cells;
         if(cells && cells.length > 0 && !rowSelectCellAdded){
          var firstRow = cells[0];
          if(firstRow[0] && firstRow[0].isRowSelector){
           console.debug('addRowSelectCell() - row selector cells already added, return.');
           rowSelectCellAdded = true;
           return;
          }
          var selectDef, cellType = this.grid.selectionMode == 'single' ? dojox.grid.cells.SingleRowSelector : dojox.grid.cells.MultipleRowSelector;
          selectDef = dojo.mixin(defaultCellDef, option, {type: cellType, editable: false, notselectable: true, filterable: false, navigatable: true, nosort: true});
          dojo.forEach(inValidFields, function(field){//remove invalid fields
           if(field in selectDef){ delete selectDef[field]; }
          });
          if(cells.length > 1){ selectDef.rowSpan = cells.length; }//for complicate layout
          dojo.forEach(this.cells, function(cell, i){
           if(cell.index >= 0){
            cell.index += 1;
            //console.debug('cell '+ (cell.index - 1) + ' is updated to index ' + cell.index);
           }else{
            console.warn('Error:IndirectSelection.addRowSelectCell()- cell ' + i + ' has no index!');
           }
          });
          var rowSelectCell = this.addCellDef(0, 0, selectDef);
          rowSelectCell.index = 0;
          firstRow.unshift(rowSelectCell);
          this.cells.unshift(rowSelectCell);
          this.grid.rowSelectCell = rowSelectCell;
          rowSelectCellAdded = true;
         }
        }, this);
        this.cellCount = this.cells.length;
    • summary
      Add indirectSelection cell(mapped to a column of radio button|check boxes)
  • dojox.grid.enhanced.plugins.IndirectSelection.destroy

    • type
      Function
    • source: [view]
        this.grid.rowSelectCell.destroy();
        delete this.grid.rowSelectCell;
        this.inherited(arguments);
    • summary
  • dojox.grid.enhanced.plugins.IndirectSelection.grid.selectionMode

    • summary
  • dojox.grid.enhanced.plugins.IndirectSelection.grid.rowSelectCell

    • summary
  • dojox.grid.enhanced.plugins.IndirectSelection.cellCount

    • summary
  • dojox.grid.cells.RowSelector

    • type
      Function
    • chains:
      • dojox.grid.cells._Widget: (prototype)
      • dojox.grid.cells._Widget: (call)
    • summary
      Common attributes &amp; functions for row selectors(Radio|CheckBox)
    • source: [view]
        this.map = {}; this.disabledMap = {}, this.disabledCount= 0;
        this._connects = []; this._subscribes = [];
        this.inA11YMode = dojo.hasClass(dojo.body(), "dijit_a11y");

        
        this.baseClass = "dojoxGridRowSelector dijitReset dijitInline dijit" + this.inputType;
        this.checkedClass = " dijit" + this.inputType + "Checked";
        this.disabledClass = " dijit" + this.inputType + "Disabled";
        this.checkedDisabledClass = " dijit" + this.inputType + "CheckedDisabled";
        this.statusTextClass = " dojoxGridRowSelectorStatusText";//a11y use


        this._connects.push(dojo.connect(this.grid, 'dokeyup', this, '_dokeyup'));
        this._connects.push(dojo.connect(this.grid.selection, 'onSelected', this, '_onSelected'));
        this._connects.push(dojo.connect(this.grid.selection, 'onDeselected', this, '_onDeselected'));
        this._connects.push(dojo.connect(this.grid.scroller, 'invalidatePageNode', this, '_pageDestroyed'));
        this._connects.push(dojo.connect(this.grid, 'onCellClick', this, '_onClick'));
        this._connects.push(dojo.connect(this.grid, 'updateRow', this, '_onUpdateRow'));
  • dojox.grid.cells.RowSelector.inputType

    • type
      String
    • summary
      Input type - Radio|CheckBox
  • dojox.grid.cells.RowSelector.map

    • type
      Object
    • summary
      Cache div refs of radio|checkbox to avoid querying each time
  • dojox.grid.cells.RowSelector.disabledMap

    • type
      Object
    • summary
      Cache index of disabled rows
  • dojox.grid.cells.RowSelector.isRowSelector

    • type
      Boolean
    • summary
      Marker of indirectSelection cell(column)
  • dojox.grid.cells.RowSelector._connects

    • type
      Array
    • summary
      List of all connections.
  • dojox.grid.cells.RowSelector._subscribes

    • type
      Array
    • summary
      List of all subscribes.
  • dojox.grid.cells.RowSelector.checkedText

    • type
      String
    • summary
      Checked character for high contrast mode
  • dojox.grid.cells.RowSelector.unCheckedText

    • type
      String
    • summary
      Unchecked character for high contrast mode
  • dojox.grid.cells.RowSelector.formatter

    • type
      Function
    • parameters:
      • data: (typeof )
      • rowIndex: (typeof )
    • source: [view]
        var clazz = this.baseClass;
        var checked = this.getValue(rowIndex);
        var disabled = !!this.disabledMap[rowIndex];//normalize 'undefined'

        
        if(checked){
         clazz += this.checkedClass;
         if(disabled){ clazz += this.checkedDisabledClass; }
        }else if(disabled){
         clazz += this.disabledClass;
        }
        return ["
          "id = '" + this.grid.id + "_rowSelector_" + rowIndex + "' ",
          "name = '" + this.grid.id + "_rowSelector' class = '" + clazz + "' ",
          "role = 'presentation' aria-pressed = '" + checked + "' aria-disabled = '" + disabled +
          "' aria-label = '" + dojo.string.substitute(this.grid._nls["indirectSelection" + this.inputType], [rowIndex + 1]) + "'>",
          "" + (checked ? this.checkedText : this.unCheckedText) + "",
          "
      "].join("");
    • summary
      Overwritten, see dojox.grid.cells._Widget
  • dojox.grid.cells.RowSelector.setValue

    • type
      Function
    • parameters:
      • rowIndex: (typeof )
      • inValue: (typeof )
    • source: [view]
        // summary:
        //  Overwritten, see dojox.grid.cells._Widget
        //  Simply return, no action
    • summary
      Overwritten, see dojox.grid.cells._Widget
      Simply return, no action
  • dojox.grid.cells.RowSelector.getValue

    • type
      Function
    • parameters:
      • rowIndex: (typeof )
    • source: [view]
        return this.grid.selection.isSelected(rowIndex);
    • summary
      Overwritten, see dojox.grid.cells._Widget
  • dojox.grid.cells.RowSelector.toggleRow

    • type
      Function
    • parameters:
      • index: (typeof Integer)
        Row index
      • value: (typeof Boolean)
        True - checked | False - unchecked
    • source: [view]
        this._nativeSelect(index, value);
    • summary
      toggle checked | unchecked state for given row
  • dojox.grid.cells.RowSelector.setDisabled

    • type
      Function
    • parameters:
      • index: (typeof )
      • disabled: (typeof Boolean)
        True - disabled | False - enabled
    • source: [view]
        if(index < 0){ return; }
        this._toggleDisabledStyle(index, disabled);
    • summary
      toggle disabled | enabled state for given row
      idx: Integer
      Row index
  • dojox.grid.cells.RowSelector.disabled

    • type
      Function
    • parameters:
      • index: (typeof )
    • source: [view]
        return !!this.disabledMap[index];
    • summary
      Check if one row is disabled
  • dojox.grid.cells.RowSelector._onClick

    • type
      Function
    • parameters:
      • e: (typeof )
    • source: [view]
        if(e.cell === this){
         this._selectRow(e);
        }
    • summary
      When mouse click on the selector cell, select/deselect the row.
  • dojox.grid.cells.RowSelector._dokeyup

    • type
      Function
    • parameters:
      • e: (typeof Event)
        Key up event
    • source: [view]
        if(e.cellIndex == this.index && e.rowIndex >= 0 && e.keyCode == dojo.keys.SPACE){
         this._selectRow(e);
        }
    • summary
      Event handler for key up event
      - from dojox.grid.enhanced._Events.dokeyup()
  • dojox.grid.cells.RowSelector.focus

    • type
      Function
    • parameters:
      • rowIndex: (typeof Integer)
        Target row
    • source: [view]
        var selector = this.map[rowIndex];
        if(selector){ selector.focus(); }
    • summary
      Set focus to given row
  • dojox.grid.cells.RowSelector._focusEndingCell

    • type
      Function
    • parameters:
      • rowIndex: (typeof Integer)
        Row index
      • cellIndex: (typeof Integer)
        Column index
    • source: [view]
        var cell = this.grid.getCell(cellIndex);
        this.grid.focus.setFocusCell(cell, rowIndex);
    • summary
      Set focus to the ending grid cell(rowIndex,cellIndex) when swipe selection finished
  • dojox.grid.cells.RowSelector._nativeSelect

    • type
      Function
    • parameters:
      • index: (typeof )
      • value: (typeof )
    • source: [view]
        this.grid.selection[value ? 'select' : 'deselect'](index);
    • summary
      Use grid's native selection
  • dojox.grid.cells.RowSelector._onSelected

    • type
      Function
    • parameters:
      • index: (typeof )
    • source: [view]
        this._toggleCheckedStyle(index, true);
    • summary
      Triggered when a row is selected
  • dojox.grid.cells.RowSelector._onDeselected

    • type
      Function
    • parameters:
      • index: (typeof )
    • source: [view]
        this._toggleCheckedStyle(index, false);
    • summary
      Triggered when a row is deselected
  • dojox.grid.cells.RowSelector._onUpdateRow

    • type
      Function
    • parameters:
      • index: (typeof )
    • source: [view]
        delete this.map[index];
    • summary
      Clear cache when row is re-built.
  • dojox.grid.cells.RowSelector._toggleCheckedStyle

    • type
      Function
    • parameters:
      • index: (typeof )
      • value: (typeof )
    • source: [view]
        var selector = this._getSelector(index);
        if(selector){
         dojo.toggleClass(selector, this.checkedClass, value);
         if(this.disabledMap[index]){
          dojo.toggleClass(selector, this.checkedDisabledClass, value);
         }
         dijit.setWaiState(selector, 'pressed', value);
         if(this.inA11YMode){
          dojo.attr(selector.firstChild, 'innerHTML', value ? this.checkedText : this.unCheckedText);
         }
        }
    • summary
      Change css styles for checked | unchecked
  • dojox.grid.cells.RowSelector._toggleDisabledStyle

    • type
      Function
    • parameters:
      • index: (typeof )
      • disabled: (typeof )
    • source: [view]
        var selector = this._getSelector(index);
        if(selector){
         dojo.toggleClass(selector, this.disabledClass, disabled);
         if(this.getValue(index)){
          dojo.toggleClass(selector, this.checkedDisabledClass, disabled);
         }
         dijit.setWaiState(selector, 'disabled', disabled);
        }
        this.disabledMap[index] = disabled;
        if(index >= 0){
         this.disabledCount += disabled ? 1 : -1;
        }
    • summary
      Change css styles for disabled | enabled
  • dojox.grid.cells.RowSelector._getSelector

    • type
      Function
    • parameters:
      • index: (typeof )
    • source: [view]
        var selector = this.map[index];
        if(!selector){//use accurate query for better performance
         var rowNode = this.view.rowNodes[index];
         if(rowNode){
          selector = dojo.query('.dojoxGridRowSelector', rowNode)[0];
          if(selector){ this.map[index] = selector; }
         }
        }
        return selector;
    • summary
      Find selector for given row caching it if 1st time found
  • dojox.grid.cells.RowSelector._pageDestroyed

    • type
      Function
    • parameters:
      • pageIndex: (typeof Integer)
        Index of destroyed page
    • source: [view]
        var rowsPerPage = this.grid.scroller.rowsPerPage;
        var start = pageIndex * rowsPerPage, end = start + rowsPerPage - 1;
        for(var i = start; i <= end; i++){
         if(!this.map[i]){continue;}
         dojo.destroy(this.map[i]);
         delete this.map[i];
        }
        //console.log("Page ",pageIndex, " destroyed, Map=",this.map);
    • summary
      Explicitly empty map cache when a page destroyed
      See dojox.grid._Scroller.invalidatePageNode()
  • dojox.grid.cells.RowSelector.destroy

    • type
      Function
    • source: [view]
        for(var i in this.map){
         dojo.destroy(this.map[i]);
         delete this.map[i];
        }
        for(i in this.disabledMap){ delete this.disabledMap[i]; }
        dojo.forEach(this._connects, dojo.disconnect);
        dojo.forEach(this._subscribes, dojo.unsubscribe);
        delete this._connects;
        delete this._subscribes;
        //console.log('Single(Multiple)RowSelector.destroy() executed!');
    • summary
  • dojox.grid.cells.RowSelector.inA11YMode

    • summary
  • dojox.grid.cells.RowSelector.baseClass

    • summary
  • dojox.grid.cells.RowSelector.checkedClass

    • summary
  • dojox.grid.cells.RowSelector.disabledClass

    • summary
  • dojox.grid.cells.RowSelector.checkedDisabledClass

    • summary
  • dojox.grid.cells.RowSelector.statusTextClass

    • summary
  • dojox.grid.cells.SingleRowSelector

    • type
      Function
    • chains:
      • dojox.grid.cells.RowSelector: (prototype)
      • dojox.grid.cells.RowSelector: (call)
    • summary
      IndirectSelection cell(column) for single selection mode, using styles of dijit.form.RadioButton
  • dojox.grid.cells.SingleRowSelector.inputType

    • summary
  • dojox.grid.cells.SingleRowSelector._selectRow

    • type
      Function
    • parameters:
      • e: (typeof Event)
        Event fired on the target row
    • source: [view]
        var index = e.rowIndex;
        if(this.disabledMap[index]){ return; }
        this._focusEndingCell(index, 0);
        this._nativeSelect(index, !this.grid.selection.selected[index]);
    • summary
      Select the target row
  • dojox.grid.cells.MultipleRowSelector

    • type
      Function
    • chains:
      • dojox.grid.cells.RowSelector: (prototype)
      • dojox.grid.cells.RowSelector: (call)
    • summary
      Indirect selection cell for multiple or extended mode, using dijit.form.CheckBox
    • source: [view]
        this._connects.push(dojo.connect(dojo.doc, 'onmouseup', this, '_domouseup'));
        this._connects.push(dojo.connect(this.grid, 'onRowMouseOver', this, '_onRowMouseOver'));
        this._connects.push(dojo.connect(this.grid.focus, 'move', this, '_swipeByKey'));
        this._connects.push(dojo.connect(this.grid, 'onCellMouseDown', this, '_onMouseDown'));
        if(this.headerSelector){//option set by user to add a select-all checkbox in column header
         this._connects.push(dojo.connect(this.grid.views, 'render', this, '_addHeaderSelector'));
         this._connects.push(dojo.connect(this.grid, 'onSelectionChanged', this, '_onSelectionChanged'));
         this._connects.push(dojo.connect(this.grid, 'onKeyDown', this, function(e){
          if(e.rowIndex == -1 && e.cellIndex == this.index && e.keyCode == dojo.keys.SPACE){
           this._toggletHeader();//TBD - a better way
          }
         }));
        }
  • dojox.grid.cells.MultipleRowSelector.inputType

    • summary
  • dojox.grid.cells.MultipleRowSelector.swipeStartRowIndex

    • type
      Integer
    • summary
      Start row index for swipe selection
  • dojox.grid.cells.MultipleRowSelector.swipeMinRowIndex

    • type
      Integer
    • summary
      Max row index for swipe selection
  • dojox.grid.cells.MultipleRowSelector.swipeMaxRowIndex

    • summary
  • dojox.grid.cells.MultipleRowSelector.toSelect

    • type
      Boolean
    • summary
      new state for selection
  • dojox.grid.cells.MultipleRowSelector.lastClickRowIdx

    • type
      Integer
    • summary
      Row index for last click, used for range selection via Shift + click
  • dojox.grid.cells.MultipleRowSelector.toggleAllTrigerred

    • type
      Boolean
    • summary
      Whether toggle all has been triggered or not
  • dojox.grid.cells.MultipleRowSelector.unCheckedText

    • summary
  • dojox.grid.cells.MultipleRowSelector.toggleAllSelection

    • summary
  • dojox.grid.cells.MultipleRowSelector._onMouseDown

    • type
      Function
    • parameters:
      • e: (typeof )
    • source: [view]
        if(e.cell == this){
         this._startSelection(e.rowIndex);
         dojo.stopEvent(e);
        }
    • summary
  • dojox.grid.cells.MultipleRowSelector._onRowMouseOver

    • type
      Function
    • parameters:
      • e: (typeof Event)
        Decorated event object which contains reference to grid, cell, and rowIndex
    • source: [view]
        this._updateSelection(e, 0);
    • summary
      Event fired when mouse moves over a data row(outside of this column).
      - from dojox.grid.enhanced._Events.onRowMouseOver()
  • dojox.grid.cells.MultipleRowSelector._domouseup

    • type
      Function
    • parameters:
      • e: (typeof Event)
        Mouse up event
    • source: [view]
        if(dojo.isIE){
         this.view.content.decorateEvent(e);//TODO - why only e in IE hasn't been decorated?
        }
        var inSwipeSelection = e.cellIndex >= 0 && this.inSwipeSelection() && !this.grid.edit.isEditRow(e.rowIndex);
        if(inSwipeSelection){
         this._focusEndingCell(e.rowIndex, e.cellIndex);
        }
        this._finishSelect();
    • summary
      Event handler for mouse up event - from dojo.doc.domouseup()
  • dojox.grid.cells.MultipleRowSelector._dokeyup

    • type
      Function
    • parameters:
      • e: (typeof Event)
        Key up event
    • source: [view]
        this.inherited(arguments);
        if(!e.shiftKey){
         this._finishSelect();
        }
    • summary
      Event handler for key up event
      - from dojox.grid.enhanced._Events.dokeyup()
  • dojox.grid.cells.MultipleRowSelector._startSelection

    • type
      Function
    • parameters:
      • rowIndex: (typeof Integer)
        Index of the start row
    • source: [view]
        this.swipeStartRowIndex = this.swipeMinRowIndex = this.swipeMaxRowIndex = rowIndex;
        this.toSelect = !this.getValue(rowIndex);
    • summary
      Initialize parameters to start a new swipe selection
  • dojox.grid.cells.MultipleRowSelector._updateSelection

    • type
      Function
    • parameters:
      • e: (typeof Event)
        Event of the current row,
      • delta: (typeof Integer)
        Row index delta, used for swipe selection via Shift + Arrow key
        0: not via key, -1 : Shift +  Up, 1 : Shift + Down
    • source: [view]
        if(!this.inSwipeSelection()){ return; }

        
        var byKey = delta !== 0;//whether via Shift + Arrow Key
        var currRow = e.rowIndex, deltaRow = currRow - this.swipeStartRowIndex + delta;
        if(deltaRow > 0 && this.swipeMaxRowIndex < currRow + delta){
         this.swipeMaxRowIndex = currRow + delta;
        }
        if(deltaRow < 0 && this.swipeMinRowIndex > currRow + delta){
         this.swipeMinRowIndex = currRow + delta;
        }


        var min = deltaRow > 0 ? this.swipeStartRowIndex : currRow + delta;
        var max = deltaRow > 0 ? currRow + delta : this.swipeStartRowIndex;
        for(var i = this.swipeMinRowIndex; i <= this.swipeMaxRowIndex; i++){
         if(this.disabledMap[i] || i < 0){ continue; }
         if(i >= min && i <= max){//deltaRow != 0 || this.toSelect
          this._nativeSelect(i, this.toSelect);
         }else if(!byKey){
          this._nativeSelect(i, !this.toSelect);
         }
        }
    • summary
      Update row selections, fired during a swipe selection
  • dojox.grid.cells.MultipleRowSelector._swipeByKey

    • type
      Function
    • parameters:
      • rowOffset: (typeof Integer)
        Row offset, used for swipe selection via Shift + Cursor
        -1 : Shift +  Up, 1 : Shift + Down
      • colOffset: (typeof )
      • e: (typeof Event)
        Event of the current row,
    • source: [view]
        if(!e || rowOffset === 0 || !e.shiftKey || e.cellIndex != this.index ||
         this.grid.focus.rowIndex < 0){ //TBD - e.rowIndex == 0 && delta == -1
         return;
        }
        var rowIndex = e.rowIndex;
        if(this.swipeStartRowIndex < 0){
         //A new swipe selection starts via Shift + Arrow key
         this.swipeStartRowIndex = rowIndex;
         if(rowOffset > 0){//Shift + Down
          this.swipeMaxRowIndex = rowIndex + rowOffset;
          this.swipeMinRowIndex = rowIndex;
         }else{//Shift + UP
          this.swipeMinRowIndex = rowIndex + rowOffset;
          this.swipeMaxRowIndex = rowIndex;
         }
         this.toSelect = this.getValue(rowIndex);
        }
        this._updateSelection(e, rowOffset);
    • summary
      Update row selections, fired when Shift + Cursor is used for swipe selection
      See dojox.grid.enhanced._Events.onKeyDown
  • dojox.grid.cells.MultipleRowSelector._finishSelect

    • type
      Function
    • source: [view]
        this.swipeStartRowIndex = -1;
        this.swipeMinRowIndex = -1;
        this.swipeMaxRowIndex = -1;
        this.toSelect = false;
    • summary
      Reset parameters to end a swipe selection
  • dojox.grid.cells.MultipleRowSelector.inSwipeSelection

    • type
      Function
    • source: [view]
        return this.swipeStartRowIndex >= 0;
    • summary
      Check if during a swipe selection
      return: Boolean
      Whether in swipe selection
  • dojox.grid.cells.MultipleRowSelector._nativeSelect

    • type
      Function
    • parameters:
      • index: (typeof )
      • value: (typeof )
    • source: [view]
        this.grid.selection[value ? 'addToSelection' : 'deselect'](index);
    • summary
      Overwritten
  • dojox.grid.cells.MultipleRowSelector._selectRow

    • type
      Function
    • parameters:
      • e: (typeof Event)
        Event fired on the target row
    • source: [view]
        var rowIndex = e.rowIndex;
        if(this.disabledMap[rowIndex]){ return; }
        dojo.stopEvent(e);
        this._focusEndingCell(rowIndex, 0);

        
        var delta = rowIndex - this.lastClickRowIdx;
        var newValue = !this.grid.selection.selected[rowIndex];
        if(this.lastClickRowIdx >= 0 && !e.ctrlKey && !e.altKey && e.shiftKey){
         var min = delta > 0 ? this.lastClickRowIdx : rowIndex;
         var max = delta > 0 ? rowIndex : this.lastClickRowIdx;
         for(var i = min; i >= 0 && i <= max; i++){
          this._nativeSelect(i, newValue);
         }
        }else{
         this._nativeSelect(rowIndex, newValue);
        }
        this.lastClickRowIdx = rowIndex;
    • summary
      Select the target row or range or rows
  • dojox.grid.cells.MultipleRowSelector.getValue

    • type
      Function
    • parameters:
      • rowIndex: (typeof )
    • source: [view]
        if(rowIndex == -1){//header selector
         var g = this.grid;
         return g.rowCount > 0 && g.rowCount <= g.selection.getSelectedCount();
        }
        return this.inherited(arguments);
    • summary
      Overwritten
  • dojox.grid.cells.MultipleRowSelector._addHeaderSelector

    • type
      Function
    • source: [view]
        var headerCellNode = this.view.getHeaderCellNode(this.index);
        if(!headerCellNode){ return; }
        dojo.empty(headerCellNode);
        var g = this.grid;
        var selector = headerCellNode.appendChild(dojo.create("div", {
         "tabindex": -1, "id": g.id + "_rowSelector_-1", "class": this.baseClass, "role": "presentation",
         "innerHTML": "" +
          g._nls["selectAll"] + "
      "
        }));
        this.map[-1] = selector;
        var idx = this._headerSelectorConnectIdx;
        if(idx !== undefined){
         dojo.disconnect(this._connects[idx]);
         this._connects.splice(idx, 1);
        }
        this._headerSelectorConnectIdx = this._connects.length;
        this._connects.push(dojo.connect(selector, 'onclick', this, '_toggletHeader'));
        this._onSelectionChanged();
    • summary
      Add selector in column header for selecting|deselecting all
  • dojox.grid.cells.MultipleRowSelector._toggletHeader

    • type
      Function
    • source: [view]
        if(!!this.disabledMap[-1]){ return; }
        this.grid._selectingRange = true;
        this.toggleAllSelection(!this.getValue(-1));
        this._onSelectionChanged();
        this.grid._selectingRange = false;
    • summary
      Toggle state for head selector
  • dojox.grid.cells.MultipleRowSelector._onSelectionChanged

    • type
      Function
    • source: [view]
        var g = this.grid;
        if(!this.map[-1] || g._selectingRange){ return; }
        this._toggleCheckedStyle(-1, this.getValue(-1));
    • summary
      Update header selector anytime selection changed
  • dojox.grid.cells.MultipleRowSelector._toggleDisabledStyle

    • type
      Function
    • parameters:
      • index: (typeof )
      • disabled: (typeof )
    • source: [view]
        this.inherited(arguments);
        if(this.headerSelector){
         var allDisabled = (this.grid.rowCount == this.disabledCount);
         if(allDisabled != !!this.disabledMap[-1]){//only if needed
          arguments[0] = -1;
          arguments[1] = allDisabled;
          this.inherited(arguments);
         }
        }
    • summary
      Overwritten
  • dojox.grid.cells.MultipleRowSelector._headerSelectorConnectIdx

    • summary
  • dojox.grid.cells.MultipleRowSelector.grid._selectingRange

    • summary
  • dojox.grid.cells.MultipleRowSelector.grid.rowCount

    • summary
  • defaultCellDef

    • mixins:
      • option: (normal)
    • summary
  • defaultCellDef.type

    • summary
  • defaultCellDef.editable

    • summary
  • defaultCellDef.notselectable

    • summary
  • defaultCellDef.filterable

    • summary
  • defaultCellDef.navigatable

    • summary
  • defaultCellDef.nosort

    • summary
  • dojox.grid.enhanced.plugins

    • type
      Object
    • summary
  • dojox.grid.enhanced

    • type
      Object
    • summary
  • dojox.grid

    • type
      Object
    • summary
  • dojox

    • type
      Object
    • summary