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