initial import
[roojs1] / Roo / grid / AbstractSelectionModel.js
1 /*
2  * Based on:
3  * Ext JS Library 1.1.1
4  * Copyright(c) 2006-2007, Ext JS, LLC.
5  *
6  * Originally Released Under LGPL - original licence link has changed is not relivant.
7  *
8  * Fork - LGPL
9  * <script type="text/javascript">
10  */
11
12 /**
13  * @class Roo.grid.AbstractSelectionModel
14  * @extends Roo.util.Observable
15  * Abstract base class for grid SelectionModels.  It provides the interface that should be
16  * implemented by descendant classes.  This class should not be directly instantiated.
17  * @constructor
18  */
19 Roo.grid.AbstractSelectionModel = function(){
20     this.locked = false;
21     Roo.grid.AbstractSelectionModel.superclass.constructor.call(this);
22 };
23
24 Roo.extend(Roo.grid.AbstractSelectionModel, Roo.util.Observable,  {
25     /** @ignore Called by the grid automatically. Do not call directly. */
26     init : function(grid){
27         this.grid = grid;
28         this.initEvents();
29     },
30
31     /**
32      * Locks the selections.
33      */
34     lock : function(){
35         this.locked = true;
36     },
37
38     /**
39      * Unlocks the selections.
40      */
41     unlock : function(){
42         this.locked = false;
43     },
44
45     /**
46      * Returns true if the selections are locked.
47      * @return {Boolean}
48      */
49     isLocked : function(){
50         return this.locked;
51     }
52 });