Changeset 12793

Show
Ignore:
Timestamp:
02/29/08 15:06:15 (9 months ago)
Author:
sorvell
Message:

!strict Begins to address #4984 by adding onCellMouseDown, onRowMouseDown, onHeaderCellMouseDown, and onMouseDown as accessible events in grid. Updated test_events.html to test these new mousedown events.

Location:
dojox/trunk/grid
Files:
4 modified

Legend:

Unmodified
Added
Removed
  • dojox/trunk/grid/tests/test_events.html

    r11257 r12793  
    5252                        { name: 'onCellMouseOver' }, 
    5353                        { name: 'onCellMouseOut' }, 
     54                        { name: 'onCellMouseDown' }, 
    5455                        { name: 'onRowMouseOver' }, 
    5556                        { name: 'onRowMouseOut' }, 
     57                        { name: 'onRowMouseDown' }, 
    5658                        { name: 'onHeaderCellClick' }, 
    5759                        { name: 'onHeaderClick', properties: ['rowIndex'] }, 
     
    6062                        { name: 'onHeaderCellMouseOver' }, 
    6163                        { name: 'onHeaderCellMouseOut' }, 
     64                        { name: 'onHeaderCellMouseDown' }, 
    6265                        { name: 'onHeaderMouseOver' }, 
    6366                        { name: 'onHeaderMouseOut' }, 
  • dojox/trunk/grid/_grid/builder.js

    r12791 r12793  
    146146                        } 
    147147                } 
     148        }, 
     149         
     150        domousedown: function(e){ 
     151                if (e.cellNode) 
     152                        this.grid.onMouseDown(e); 
     153                this.grid.onMouseDownRow(e) 
    148154        } 
    149155 
     
    341347                        if((this.overRightResizeArea(e) || this.overLeftResizeArea(e)) && this.canResize(e)){ 
    342348                                this.beginColumnResize(e); 
     349                        }else{ 
     350                                this.grid.onMouseDown(e); 
     351                                this.grid.onMouseOverRow(e); 
    343352                        } 
    344353                        //else{ 
  • dojox/trunk/grid/_grid/publicEvents.js

    r12742 r12793  
    130130                e.rowIndex == -1 ? this.onHeaderCellMouseOut(e) : this.onCellMouseOut(e); 
    131131        }, 
     132         
     133        onMouseDown: function(e){ 
     134                // summary: 
     135                //              Event fired when mouse is down inside grid. 
     136                // e: Event 
     137                //              Decorated event object that contains reference to grid, cell, and rowIndex 
     138                e.rowIndex == -1 ? this.onHeaderCellMouseDown(e) : this.onCellMouseDown(e); 
     139        }, 
     140         
    132141        onMouseOverRow: function(e){ 
    133142                // summary: 
     
    152161                } 
    153162        }, 
     163         
     164        onMouseDownRow: function(e){ 
     165                // summary: 
     166                //              Event fired when mouse is down inside grid row 
     167                // e: Event 
     168                //              Decorated event object that contains reference to grid, cell, and rowIndex 
     169                if(e.rowIndex != -1) 
     170                        this.onRowMouseDown(e); 
     171        }, 
    154172 
    155173        // cell events 
     
    168186                //              Decorated event object which contains reference to grid, cell, and rowIndex 
    169187                dojo.removeClass(e.cellNode, this.cellOverClass); 
     188        }, 
     189         
     190        onCellMouseDown: function(e){ 
     191                // summary: 
     192                //              Event fired when mouse is down in a header cell. 
     193                // e: Event 
     194                //              Decorated event object which contains reference to grid, cell, and rowIndex 
    170195        }, 
    171196 
     
    246271                //              Decorated event object contains reference to grid, cell, and rowIndex 
    247272        }, 
     273         
     274        onRowMouseDown: function(e){ 
     275                // summary: 
     276                //              Event fired when mouse is down in a row. 
     277                // e: Event 
     278                //              Decorated event object which contains reference to grid, cell, and rowIndex 
     279        }, 
    248280 
    249281        onRowContextMenu: function(e){ 
     
    284316                //              Decorated event object which contains reference to grid, cell, and rowIndex 
    285317                dojo.removeClass(e.cellNode, this.cellOverClass); 
     318        }, 
     319         
     320        onHeaderCellMouseDown: function(e) { 
     321                // summary: 
     322                //              Event fired when mouse is down in a header cell. 
     323                // e: Event 
     324                //              Decorated event object which contains reference to grid, cell, and rowIndex 
    286325        }, 
    287326 
  • dojox/trunk/grid/_grid/view.js

    r12791 r12793  
    3434        postCreate: function(){ 
    3535                this.connect(this.scrollboxNode,"onscroll","doscroll"); 
    36                 dojox.grid.funnelEvents(this.contentNode, this, "doContentEvent", [ 'mouseover', 'mouseout', 'click', 'dblclick', 'contextmenu' ]); 
     36                dojox.grid.funnelEvents(this.contentNode, this, "doContentEvent", [ 'mouseover', 'mouseout', 'click', 'dblclick', 'contextmenu', 'mousedown' ]); 
    3737                dojox.grid.funnelEvents(this.headerNode, this, "doHeaderEvent", [ 'dblclick', 'mouseover', 'mouseout', 'mousemove', 'mousedown', 'click', 'contextmenu' ]); 
    3838                this.content = new dojox.grid.contentBuilder(this);