X-Git-Url: http://git.ithinksw.org/extjs.git/blobdiff_plain/6746dc89c47ed01b165cc1152533605f97eb8e8d..f562e4c6e5fac7bcb445985b99acbea4d706e6f0:/docs/source/RowModel.html diff --git a/docs/source/RowModel.html b/docs/source/RowModel.html index 45a26297..3cc6c8b2 100644 --- a/docs/source/RowModel.html +++ b/docs/source/RowModel.html @@ -3,8 +3,8 @@ The source code - - + + @@ -18,10 +18,6 @@
/**
  * @class Ext.selection.RowModel
  * @extends Ext.selection.Model
- *
- * Implement row based navigation via keyboard.
- *
- * Must synchronize across grid sections
  */
 Ext.define('Ext.selection.RowModel', {
     extend: 'Ext.selection.Model',
@@ -38,9 +34,17 @@ Ext.define('Ext.selection.RowModel', {
     /**
      * @cfg {Boolean} enableKeyNav
      *
-     * Turns on/off keyboard navigation within the grid. Defaults to true.
+     * Turns on/off keyboard navigation within the grid.
      */
     enableKeyNav: true,
+    
+    /**
+     * @cfg {Boolean} [ignoreRightMouseSelection=true]
+     * True to ignore selections that are made when using the right mouse button if there are
+     * records that are already selected. If no records are selected, selection will continue 
+     * as normal
+     */
+    ignoreRightMouseSelection: true,
 
     constructor: function(){
         this.addEvents(
@@ -48,7 +52,7 @@ Ext.define('Ext.selection.RowModel', {
              * @event beforedeselect
              * Fired before a record is deselected. If any listener returns false, the
              * deselection is cancelled.
-             * @param {Ext.selection.RowSelectionModel} this
+             * @param {Ext.selection.RowModel} this
              * @param {Ext.data.Model} record The deselected record
              * @param {Number} index The row index deselected
              */
@@ -58,7 +62,7 @@ Ext.define('Ext.selection.RowModel', {
              * @event beforeselect
              * Fired before a record is selected. If any listener returns false, the
              * selection is cancelled.
-             * @param {Ext.selection.RowSelectionModel} this
+             * @param {Ext.selection.RowModel} this
              * @param {Ext.data.Model} record The selected record
              * @param {Number} index The row index selected
              */
@@ -67,7 +71,7 @@ Ext.define('Ext.selection.RowModel', {
             /**
              * @event deselect
              * Fired after a record is deselected
-             * @param {Ext.selection.RowSelectionModel} this
+             * @param {Ext.selection.RowModel} this
              * @param {Ext.data.Model} record The deselected record
              * @param {Number} index The row index deselected
              */
@@ -76,7 +80,7 @@ Ext.define('Ext.selection.RowModel', {
             /**
              * @event select
              * Fired after a record is selected
-             * @param {Ext.selection.RowSelectionModel} this
+             * @param {Ext.selection.RowModel} this
              * @param {Ext.data.Model} record The selected record
              * @param {Number} index The row index selected
              */
@@ -357,8 +361,26 @@ Ext.define('Ext.selection.RowModel', {
     // we can take into account ctrlKey, shiftKey, etc
     onRowMouseDown: function(view, record, item, index, e) {
         view.el.focus();
+        if (!this.allowRightMouseSelection(e)) {
+            return;
+        }
         this.selectWithEvent(record, e);
     },
+    
+    /**
+     * Checks whether a selection should proceed based on the ignoreRightMouseSelection
+     * option.
+     * @private
+     * @param {Ext.EventObject} e The event
+     * @return {Boolean} False if the selection should not proceed
+     */
+    allowRightMouseSelection: function(e) {
+        var disallow = this.ignoreRightMouseSelection && e.button !== 0;
+        if (disallow) {
+            disallow = this.hasSelection();
+        }
+        return !disallow;
+    },
 
     // Allow the GridView to update the UI by
     // adding/removing a CSS class from the row.