Upgrade to ExtJS 3.0.0 - Released 07/06/2009
[extjs.git] / src / widgets / grid / AbstractSelectionModel.js
1 /*!
2  * Ext JS Library 3.0.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 = function(){\r
15     this.locked = false;\r
16     Ext.grid.AbstractSelectionModel.superclass.constructor.call(this);\r
17 };\r
18 \r
19 Ext.extend(Ext.grid.AbstractSelectionModel, Ext.util.Observable,  {\r
20     /**\r
21      * The GridPanel for which this SelectionModel is handling selection. Read-only.\r
22      * @type Object\r
23      * @property grid\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 });