Upgrade to ExtJS 4.0.1 - Released 05/18/2011
[extjs.git] / docs / source / HeaderReorderer.html
1 <!DOCTYPE html>
2 <html>
3 <head>
4   <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
5   <title>The source code</title>
6   <link href="../prettify/prettify.css" type="text/css" rel="stylesheet" />
7   <script type="text/javascript" src="../prettify/prettify.js"></script>
8   <style type="text/css">
9     .highlight { display: block; background-color: #ddd; }
10   </style>
11   <script type="text/javascript">
12     function highlight() {
13       document.getElementById(location.hash.replace(/#/, "")).className = "highlight";
14     }
15   </script>
16 </head>
17 <body onload="prettyPrint(); highlight();">
18   <pre class="prettyprint lang-js"><span id='Ext-grid-plugin-HeaderReorderer'>/**
19 </span> * @class Ext.grid.plugin.HeaderReorderer
20  * @extends Ext.util.Observable
21  * @private
22  */
23 Ext.define('Ext.grid.plugin.HeaderReorderer', {
24     extend: 'Ext.util.Observable',
25     requires: ['Ext.grid.header.DragZone', 'Ext.grid.header.DropZone'],
26     alias: 'plugin.gridheaderreorderer',
27
28     init: function(headerCt) {
29         this.headerCt = headerCt;
30         headerCt.on('render', this.onHeaderCtRender, this);
31     },
32
33 <span id='Ext-grid-plugin-HeaderReorderer-method-destroy'>    /**
34 </span>     * @private
35      * AbstractComponent calls destroy on all its plugins at destroy time.
36      */
37     destroy: function() {
38         Ext.destroy(this.dragZone, this.dropZone);
39     },
40
41     onHeaderCtRender: function() {
42         this.dragZone = Ext.create('Ext.grid.header.DragZone', this.headerCt);
43         this.dropZone = Ext.create('Ext.grid.header.DropZone', this.headerCt);
44         if (this.disabled) {
45             this.dragZone.disable();
46         }
47     },
48     
49     enable: function() {
50         this.disabled = false;
51         if (this.dragZone) {
52             this.dragZone.enable();
53         }
54     },
55     
56     disable: function() {
57         this.disabled = true;
58         if (this.dragZone) {
59             this.dragZone.disable();
60         }
61     }
62 });</pre>
63 </body>
64 </html>