commit extjs-2.2.1
[extjs.git] / source / widgets / grid / AbstractSelectionModel.js
1 /*\r
2  * Ext JS Library 2.2.1\r
3  * Copyright(c) 2006-2009, Ext JS, LLC.\r
4  * licensing@extjs.com\r
5  * \r
6  * http://extjs.com/license\r
7  */\r
8 \r
9 /**\r
10  * @class Ext.grid.AbstractSelectionModel\r
11  * @extends Ext.util.Observable\r
12  * Abstract base class for grid SelectionModels.  It provides the interface that should be\r
13  * implemented by descendant classes.  This class should not be directly instantiated.\r
14  * @constructor\r
15  */\r
16 Ext.grid.AbstractSelectionModel = function(){\r
17     this.locked = false;\r
18     Ext.grid.AbstractSelectionModel.superclass.constructor.call(this);\r
19 };\r
20 \r
21 Ext.extend(Ext.grid.AbstractSelectionModel, Ext.util.Observable,  {\r
22     /** @ignore Called by the grid automatically. Do not call directly. */\r
23     init : function(grid){\r
24         this.grid = grid;\r
25         this.initEvents();\r
26     },\r
27 \r
28     /**\r
29      * Locks the selections.\r
30      */\r
31     lock : function(){\r
32         this.locked = true;\r
33     },\r
34 \r
35     /**\r
36      * Unlocks the selections.\r
37      */\r
38     unlock : function(){\r
39         this.locked = false;\r
40     },\r
41 \r
42     /**\r
43      * Returns true if the selections are locked.\r
44      * @return {Boolean}\r
45      */\r
46     isLocked : function(){\r
47         return this.locked;\r
48     }\r
49 });