2 * @class Ext.multisort.SortButton
3 * @extends Ext.button.Button
8 Ext.define('Ext.multisort.SortButton', {
9 extend: 'Ext.button.Button',
10 alias : 'widget.sortbutton',
17 constructor: function(config) {
20 * @event changeDirection
21 * Fired whenever the user clicks this button to change its direction
22 * @param {String} direction The new direction (ASC or DESC)
27 this.initConfig(config);
29 this.callParent(arguments);
33 this.toggleDirection();
37 * Sets the new direction of this button
38 * @param {String} direction The new direction
40 applyDirection: function(direction) {
41 this._direction = direction;
42 this.setIconCls('direction-' + direction.toLowerCase());
44 this.fireEvent('changeDirection', direction);
50 * Toggles between ASC and DESC directions
52 toggleDirection: function() {
53 this.setDirection(Ext.String.toggle(this.getDirection(), "ASC", "DESC"));