<!DOCTYPE html>
|
<html>
|
<head>
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
<title>The source code</title>
|
<link href="../resources/prettify/prettify.css" type="text/css" rel="stylesheet" />
|
<script type="text/javascript" src="../resources/prettify/prettify.js"></script>
|
<style type="text/css">
|
.highlight { display: block; background-color: #ddd; }
|
</style>
|
<script type="text/javascript">
|
function highlight() {
|
document.getElementById(location.hash.replace(/#/, "")).className = "highlight";
|
}
|
</script>
|
</head>
|
<body onload="prettyPrint(); highlight();">
|
<pre class="prettyprint lang-js"><span id='Ext-grid-plugin-HeaderReorderer'>/**
|
</span> * @private
|
*/
|
Ext.define('Ext.grid.plugin.HeaderReorderer', {
|
extend: 'Ext.AbstractPlugin',
|
requires: ['Ext.grid.header.DragZone', 'Ext.grid.header.DropZone'],
|
alias: 'plugin.gridheaderreorderer',
|
|
<span id='Ext-grid-plugin-HeaderReorderer-method-init'> init: function(headerCt) {
|
</span> this.headerCt = headerCt;
|
headerCt.on({
|
render: this.onHeaderCtRender,
|
single: true,
|
scope: this
|
});
|
},
|
|
<span id='Ext-grid-plugin-HeaderReorderer-method-destroy'> /**
|
</span> * @private
|
* AbstractComponent calls destroy on all its plugins at destroy time.
|
*/
|
destroy: function() {
|
Ext.destroy(this.dragZone, this.dropZone);
|
},
|
|
<span id='Ext-grid-plugin-HeaderReorderer-method-onHeaderCtRender'> onHeaderCtRender: function() {
|
</span> var me = this;
|
|
me.dragZone = new Ext.grid.header.DragZone(me.headerCt);
|
me.dropZone = new Ext.grid.header.DropZone(me.headerCt);
|
if (me.disabled) {
|
me.dragZone.disable();
|
}
|
},
|
|
<span id='Ext-grid-plugin-HeaderReorderer-method-enable'> enable: function() {
|
</span> this.disabled = false;
|
if (this.dragZone) {
|
this.dragZone.enable();
|
}
|
},
|
|
<span id='Ext-grid-plugin-HeaderReorderer-method-disable'> disable: function() {
|
</span> this.disabled = true;
|
if (this.dragZone) {
|
this.dragZone.disable();
|
}
|
}
|
});
|
</pre>
|
</body>
|
</html>
|