PageRenderTime 71ms CodeModel.GetById 20ms app.highlight 40ms RepoModel.GetById 1ms app.codeStats 0ms

/hippo/src/main/webapp/yui/datatable/datatable-debug.js

http://hdbc.googlecode.com/
JavaScript | 2037 lines | 887 code | 216 blank | 934 comment | 195 complexity | 9d7b699ff8ed1b88a66ad4840e2ef2c3 MD5 | raw file

Large files files are truncated, but you can click here to view the full file

   1/*
   2Copyright (c) 2009, Yahoo! Inc. All rights reserved.
   3Code licensed under the BSD License:
   4http://developer.yahoo.net/yui/license.txt
   5version: 2.7.0
   6*/
   7/**
   8 * Mechanism to execute a series of callbacks in a non-blocking queue.  Each callback is executed via setTimout unless configured with a negative timeout, in which case it is run in blocking mode in the same execution thread as the previous callback.  Callbacks can be function references or object literals with the following keys:
   9 * <ul>
  10 *    <li><code>method</code> - {Function} REQUIRED the callback function.</li>
  11 *    <li><code>scope</code> - {Object} the scope from which to execute the callback.  Default is the global window scope.</li>
  12 *    <li><code>argument</code> - {Array} parameters to be passed to method as individual arguments.</li>
  13 *    <li><code>timeout</code> - {number} millisecond delay to wait after previous callback completion before executing this callback.  Negative values cause immediate blocking execution.  Default 0.</li>
  14 *    <li><code>until</code> - {Function} boolean function executed before each iteration.  Return true to indicate completion and proceed to the next callback.</li>
  15 *    <li><code>iterations</code> - {Number} number of times to execute the callback before proceeding to the next callback in the chain. Incompatible with <code>until</code>.</li>
  16 * </ul>
  17 *
  18 * @namespace YAHOO.util
  19 * @class Chain
  20 * @constructor
  21 * @param callback* {Function|Object} Any number of callbacks to initialize the queue
  22*/
  23YAHOO.util.Chain = function () {
  24    /**
  25     * The callback queue
  26     * @property q
  27     * @type {Array}
  28     * @private
  29     */
  30    this.q = [].slice.call(arguments);
  31
  32    /**
  33     * Event fired when the callback queue is emptied via execution (not via
  34     * a call to chain.stop().
  35     * @event end
  36     */
  37    this.createEvent('end');
  38};
  39
  40YAHOO.util.Chain.prototype = {
  41    /**
  42     * Timeout id used to pause or stop execution and indicate the execution state of the Chain.  0 indicates paused or stopped, -1 indicates blocking execution, and any positive number indicates non-blocking execution.
  43     * @property id
  44     * @type {number}
  45     * @private
  46     */
  47    id   : 0,
  48
  49    /**
  50     * Begin executing the chain, or resume execution from the last paused position.
  51     * @method run
  52     * @return {Chain} the Chain instance
  53     */
  54    run : function () {
  55        // Grab the first callback in the queue
  56        var c  = this.q[0],
  57            fn;
  58
  59        // If there is no callback in the queue or the Chain is currently
  60        // in an execution mode, return
  61        if (!c) {
  62            this.fireEvent('end');
  63            return this;
  64        } else if (this.id) {
  65            return this;
  66        }
  67
  68        fn = c.method || c;
  69
  70        if (typeof fn === 'function') {
  71            var o    = c.scope || {},
  72                args = c.argument || [],
  73                ms   = c.timeout || 0,
  74                me   = this;
  75                
  76            if (!(args instanceof Array)) {
  77                args = [args];
  78            }
  79
  80            // Execute immediately if the callback timeout is negative.
  81            if (ms < 0) {
  82                this.id = ms;
  83                if (c.until) {
  84                    for (;!c.until();) {
  85                        // Execute the callback from scope, with argument
  86                        fn.apply(o,args);
  87                    }
  88                } else if (c.iterations) {
  89                    for (;c.iterations-- > 0;) {
  90                        fn.apply(o,args);
  91                    }
  92                } else {
  93                    fn.apply(o,args);
  94                }
  95                this.q.shift();
  96                this.id = 0;
  97                return this.run();
  98            } else {
  99                // If the until condition is set, check if we're done
 100                if (c.until) {
 101                    if (c.until()) {
 102                        // Shift this callback from the queue and execute the next
 103                        // callback
 104                        this.q.shift();
 105                        return this.run();
 106                    }
 107                // Otherwise if either iterations is not set or we're
 108                // executing the last iteration, shift callback from the queue
 109                } else if (!c.iterations || !--c.iterations) {
 110                    this.q.shift();
 111                }
 112
 113                // Otherwise set to execute after the configured timeout
 114                this.id = setTimeout(function () {
 115                    // Execute the callback from scope, with argument
 116                    fn.apply(o,args);
 117                    // Check if the Chain was not paused from inside the callback
 118                    if (me.id) {
 119                        // Indicate ready to run state
 120                        me.id = 0;
 121                        // Start the fun all over again
 122                        me.run();
 123                    }
 124                },ms);
 125            }
 126        }
 127
 128        return this;
 129    },
 130    
 131    /**
 132     * Add a callback to the end of the queue
 133     * @method add
 134     * @param c {Function|Object} the callback function ref or object literal
 135     * @return {Chain} the Chain instance
 136     */
 137    add  : function (c) {
 138        this.q.push(c);
 139        return this;
 140    },
 141
 142    /**
 143     * Pause the execution of the Chain after the current execution of the
 144     * current callback completes.  If called interstitially, clears the
 145     * timeout for the pending callback. Paused Chains can be restarted with
 146     * chain.run()
 147     * @method pause
 148     * @return {Chain} the Chain instance
 149     */
 150    pause: function () {
 151        clearTimeout(this.id);
 152        this.id = 0;
 153        return this;
 154    },
 155
 156    /**
 157     * Stop and clear the Chain's queue after the current execution of the
 158     * current callback completes.
 159     * @method stop
 160     * @return {Chain} the Chain instance
 161     */
 162    stop : function () { 
 163        this.pause();
 164        this.q = [];
 165        return this;
 166    }
 167};
 168YAHOO.lang.augmentProto(YAHOO.util.Chain,YAHOO.util.EventProvider);
 169
 170/****************************************************************************/
 171/****************************************************************************/
 172/****************************************************************************/
 173
 174/**
 175 * The ColumnSet class defines and manages a DataTable's Columns,
 176 * including nested hierarchies and access to individual Column instances.
 177 *
 178 * @namespace YAHOO.widget
 179 * @class ColumnSet
 180 * @uses YAHOO.util.EventProvider
 181 * @constructor
 182 * @param aDefinitions {Object[]} Array of object literals that define cells in
 183 * the THEAD.
 184 */
 185YAHOO.widget.ColumnSet = function(aDefinitions) {
 186    this._sId = "yui-cs" + YAHOO.widget.ColumnSet._nCount;
 187
 188    // First clone the defs
 189    aDefinitions = YAHOO.widget.DataTable._cloneObject(aDefinitions);
 190    this._init(aDefinitions);
 191
 192    YAHOO.widget.ColumnSet._nCount++;
 193    YAHOO.log("ColumnSet initialized", "info", this.toString());
 194};
 195
 196/////////////////////////////////////////////////////////////////////////////
 197//
 198// Private member variables
 199//
 200/////////////////////////////////////////////////////////////////////////////
 201
 202/**
 203 * Internal class variable to index multiple ColumnSet instances.
 204 *
 205 * @property ColumnSet._nCount
 206 * @type Number
 207 * @private
 208 * @static
 209 */
 210YAHOO.widget.ColumnSet._nCount = 0;
 211
 212YAHOO.widget.ColumnSet.prototype = {
 213    /**
 214     * Unique instance name.
 215     *
 216     * @property _sId
 217     * @type String
 218     * @private
 219     */
 220    _sId : null,
 221
 222    /**
 223     * Array of object literal Column definitions passed to the constructor.
 224     *
 225     * @property _aDefinitions
 226     * @type Object[]
 227     * @private
 228     */
 229    _aDefinitions : null,
 230
 231    /////////////////////////////////////////////////////////////////////////////
 232    //
 233    // Public member variables
 234    //
 235    /////////////////////////////////////////////////////////////////////////////
 236
 237    /**
 238     * Top-down tree representation of Column hierarchy.
 239     *
 240     * @property tree
 241     * @type YAHOO.widget.Column[]
 242     */
 243    tree : null,
 244
 245    /**
 246     * Flattened representation of all Columns.
 247     *
 248     * @property flat
 249     * @type YAHOO.widget.Column[]
 250     * @default []
 251     */
 252    flat : null,
 253
 254    /**
 255     * Array of Columns that map one-to-one to a table column.
 256     *
 257     * @property keys
 258     * @type YAHOO.widget.Column[]
 259     * @default []
 260     */
 261    keys : null,
 262
 263    /**
 264     * ID index of nested parent hierarchies for HEADERS accessibility attribute.
 265     *
 266     * @property headers
 267     * @type String[]
 268     * @default []
 269     */
 270    headers : null,
 271
 272    /////////////////////////////////////////////////////////////////////////////
 273    //
 274    // Private methods
 275    //
 276    /////////////////////////////////////////////////////////////////////////////
 277
 278    /**
 279     * Initializes ColumnSet instance with data from Column definitions.
 280     *
 281     * @method _init
 282     * @param aDefinitions {Object[]} Array of object literals that define cells in
 283     * the THEAD .
 284     * @private
 285     */
 286
 287    _init : function(aDefinitions) {        
 288        // DOM tree representation of all Columns
 289        var tree = [];
 290        // Flat representation of all Columns
 291        var flat = [];
 292        // Flat representation of only Columns that are meant to display data
 293        var keys = [];
 294        // Array of HEADERS attribute values for all keys in the "keys" array
 295        var headers = [];
 296
 297        // Tracks current node list depth being tracked
 298        var nodeDepth = -1;
 299
 300        // Internal recursive function to define Column instances
 301        var parseColumns = function(nodeList, parent) {
 302            // One level down
 303            nodeDepth++;
 304
 305            // Create corresponding tree node if not already there for this depth
 306            if(!tree[nodeDepth]) {
 307                tree[nodeDepth] = [];
 308            }
 309
 310
 311            // Parse each node at this depth for attributes and any children
 312            for(var j=0; j<nodeList.length; j++) {
 313                var currentNode = nodeList[j];
 314
 315                // Instantiate a new Column for each node
 316                var oColumn = new YAHOO.widget.Column(currentNode);
 317                
 318                // Cross-reference Column ID back to the original object literal definition
 319                currentNode.yuiColumnId = oColumn._sId;
 320                
 321                // Add the new Column to the flat list
 322                flat.push(oColumn);
 323
 324                // Assign its parent as an attribute, if applicable
 325                if(parent) {
 326                    oColumn._oParent = parent;
 327                }
 328
 329                // The Column has descendants
 330                if(YAHOO.lang.isArray(currentNode.children)) {
 331                    oColumn.children = currentNode.children;
 332
 333                    // Determine COLSPAN value for this Column
 334                    var terminalChildNodes = 0;
 335                    var countTerminalChildNodes = function(ancestor) {
 336                        var descendants = ancestor.children;
 337                        // Drill down each branch and count terminal nodes
 338                        for(var k=0; k<descendants.length; k++) {
 339                            // Keep drilling down
 340                            if(YAHOO.lang.isArray(descendants[k].children)) {
 341                                countTerminalChildNodes(descendants[k]);
 342                            }
 343                            // Reached branch terminus
 344                            else {
 345                                terminalChildNodes++;
 346                            }
 347                        }
 348                    };
 349                    countTerminalChildNodes(currentNode);
 350                    oColumn._nColspan = terminalChildNodes;
 351
 352                    // Cascade certain properties to children if not defined on their own
 353                    var currentChildren = currentNode.children;
 354                    for(var k=0; k<currentChildren.length; k++) {
 355                        var child = currentChildren[k];
 356                        if(oColumn.className && (child.className === undefined)) {
 357                            child.className = oColumn.className;
 358                        }
 359                        if(oColumn.editor && (child.editor === undefined)) {
 360                            child.editor = oColumn.editor;
 361                        }
 362                        //TODO: Deprecated
 363                        if(oColumn.editorOptions && (child.editorOptions === undefined)) {
 364                            child.editorOptions = oColumn.editorOptions;
 365                        }
 366                        if(oColumn.formatter && (child.formatter === undefined)) {
 367                            child.formatter = oColumn.formatter;
 368                        }
 369                        if(oColumn.resizeable && (child.resizeable === undefined)) {
 370                            child.resizeable = oColumn.resizeable;
 371                        }
 372                        if(oColumn.sortable && (child.sortable === undefined)) {
 373                            child.sortable = oColumn.sortable;
 374                        }
 375                        if(oColumn.hidden) {
 376                            child.hidden = true;
 377                        }
 378                        if(oColumn.width && (child.width === undefined)) {
 379                            child.width = oColumn.width;
 380                        }
 381                        if(oColumn.minWidth && (child.minWidth === undefined)) {
 382                            child.minWidth = oColumn.minWidth;
 383                        }
 384                        if(oColumn.maxAutoWidth && (child.maxAutoWidth === undefined)) {
 385                            child.maxAutoWidth = oColumn.maxAutoWidth;
 386                        }
 387                        // Backward compatibility
 388                        if(oColumn.type && (child.type === undefined)) {
 389                            child.type = oColumn.type;
 390                        }
 391                        if(oColumn.type && !oColumn.formatter) {
 392                            YAHOO.log("The property type has been" +
 393                            " deprecated in favor of formatter", "warn", oColumn.toString());
 394                            oColumn.formatter = oColumn.type;
 395                        }
 396                        if(oColumn.text && !YAHOO.lang.isValue(oColumn.label)) {
 397                            YAHOO.log("The property text has been" +
 398                            " deprecated in favor of label", "warn", oColumn.toString());
 399                            oColumn.label = oColumn.text;
 400                        }
 401                        if(oColumn.parser) {
 402                            YAHOO.log("The property parser is no longer supported",
 403                            "warn", this.toString());
 404                        }
 405                        if(oColumn.sortOptions && ((oColumn.sortOptions.ascFunction) ||
 406                                (oColumn.sortOptions.descFunction))) {
 407                            YAHOO.log("The properties sortOptions.ascFunction and " +
 408                            " sortOptions.descFunction have been deprecated in favor " +
 409                            " of sortOptions.sortFunction", "warn", oColumn.toString());
 410                        }
 411                    }
 412
 413                    // The children themselves must also be parsed for Column instances
 414                    if(!tree[nodeDepth+1]) {
 415                        tree[nodeDepth+1] = [];
 416                    }
 417                    parseColumns(currentChildren, oColumn);
 418                }
 419                // This Column does not have any children
 420                else {
 421                    oColumn._nKeyIndex = keys.length;
 422                    oColumn._nColspan = 1;
 423                    keys.push(oColumn);
 424                }
 425
 426                // Add the Column to the top-down tree
 427                tree[nodeDepth].push(oColumn);
 428            }
 429            nodeDepth--;
 430        };
 431
 432        // Parse out Column instances from the array of object literals
 433        if(YAHOO.lang.isArray(aDefinitions)) {
 434            parseColumns(aDefinitions);
 435
 436            // Store the array
 437            this._aDefinitions = aDefinitions;
 438        }
 439        else {
 440            YAHOO.log("Could not initialize ColumnSet due to invalid definitions","error");
 441            return null;
 442        }
 443
 444        var i;
 445
 446        // Determine ROWSPAN value for each Column in the tree
 447        var parseTreeForRowspan = function(tree) {
 448            var maxRowDepth = 1;
 449            var currentRow;
 450            var currentColumn;
 451
 452            // Calculate the max depth of descendants for this row
 453            var countMaxRowDepth = function(row, tmpRowDepth) {
 454                tmpRowDepth = tmpRowDepth || 1;
 455
 456                for(var n=0; n<row.length; n++) {
 457                    var col = row[n];
 458                    // Column has children, so keep counting
 459                    if(YAHOO.lang.isArray(col.children)) {
 460                        tmpRowDepth++;
 461                        countMaxRowDepth(col.children, tmpRowDepth);
 462                        tmpRowDepth--;
 463                    }
 464                    // No children, is it the max depth?
 465                    else {
 466                        if(tmpRowDepth > maxRowDepth) {
 467                            maxRowDepth = tmpRowDepth;
 468                        }
 469                    }
 470
 471                }
 472            };
 473
 474            // Count max row depth for each row
 475            for(var m=0; m<tree.length; m++) {
 476                currentRow = tree[m];
 477                countMaxRowDepth(currentRow);
 478
 479                // Assign the right ROWSPAN values to each Column in the row
 480                for(var p=0; p<currentRow.length; p++) {
 481                    currentColumn = currentRow[p];
 482                    if(!YAHOO.lang.isArray(currentColumn.children)) {
 483                        currentColumn._nRowspan = maxRowDepth;
 484                    }
 485                    else {
 486                        currentColumn._nRowspan = 1;
 487                    }
 488                }
 489
 490                // Reset counter for next row
 491                maxRowDepth = 1;
 492            }
 493        };
 494        parseTreeForRowspan(tree);
 495
 496        // Store tree index values
 497        for(i=0; i<tree[0].length; i++) {
 498            tree[0][i]._nTreeIndex = i;
 499        }
 500
 501        // Store header relationships in an array for HEADERS attribute
 502        var recurseAncestorsForHeaders = function(i, oColumn) {
 503            headers[i].push(oColumn.getSanitizedKey());
 504            if(oColumn._oParent) {
 505                recurseAncestorsForHeaders(i, oColumn._oParent);
 506            }
 507        };
 508        for(i=0; i<keys.length; i++) {
 509            headers[i] = [];
 510            recurseAncestorsForHeaders(i, keys[i]);
 511            headers[i] = headers[i].reverse();
 512        }
 513
 514        // Save to the ColumnSet instance
 515        this.tree = tree;
 516        this.flat = flat;
 517        this.keys = keys;
 518        this.headers = headers;
 519    },
 520
 521    /////////////////////////////////////////////////////////////////////////////
 522    //
 523    // Public methods
 524    //
 525    /////////////////////////////////////////////////////////////////////////////
 526
 527    /**
 528     * Returns unique name of the ColumnSet instance.
 529     *
 530     * @method getId
 531     * @return {String} Unique name of the ColumnSet instance.
 532     */
 533
 534    getId : function() {
 535        return this._sId;
 536    },
 537
 538    /**
 539     * ColumnSet instance name, for logging.
 540     *
 541     * @method toString
 542     * @return {String} Unique name of the ColumnSet instance.
 543     */
 544
 545    toString : function() {
 546        return "ColumnSet instance " + this._sId;
 547    },
 548
 549    /**
 550     * Public accessor to the definitions array.
 551     *
 552     * @method getDefinitions
 553     * @return {Object[]} Array of object literal Column definitions.
 554     */
 555
 556    getDefinitions : function() {
 557        var aDefinitions = this._aDefinitions;
 558        
 559        // Internal recursive function to define Column instances
 560        var parseColumns = function(nodeList, oSelf) {
 561            // Parse each node at this depth for attributes and any children
 562            for(var j=0; j<nodeList.length; j++) {
 563                var currentNode = nodeList[j];
 564                
 565                // Get the Column for each node
 566                var oColumn = oSelf.getColumnById(currentNode.yuiColumnId);
 567                
 568                if(oColumn) {    
 569                    // Update the current values
 570                    var oDefinition = oColumn.getDefinition();
 571                    for(var name in oDefinition) {
 572                        if(YAHOO.lang.hasOwnProperty(oDefinition, name)) {
 573                            currentNode[name] = oDefinition[name];
 574                        }
 575                    }
 576                }
 577                            
 578                // The Column has descendants
 579                if(YAHOO.lang.isArray(currentNode.children)) {
 580                    // The children themselves must also be parsed for Column instances
 581                    parseColumns(currentNode.children, oSelf);
 582                }
 583            }
 584        };
 585
 586        parseColumns(aDefinitions, this);
 587        this._aDefinitions = aDefinitions;
 588        return aDefinitions;
 589    },
 590
 591    /**
 592     * Returns Column instance with given ID.
 593     *
 594     * @method getColumnById
 595     * @param column {String} Column ID.
 596     * @return {YAHOO.widget.Column} Column instance.
 597     */
 598
 599    getColumnById : function(column) {
 600        if(YAHOO.lang.isString(column)) {
 601            var allColumns = this.flat;
 602            for(var i=allColumns.length-1; i>-1; i--) {
 603                if(allColumns[i]._sId === column) {
 604                    return allColumns[i];
 605                }
 606            }
 607        }
 608        return null;
 609    },
 610
 611    /**
 612     * Returns Column instance with given key or ColumnSet key index.
 613     *
 614     * @method getColumn
 615     * @param column {String | Number} Column key or ColumnSet key index.
 616     * @return {YAHOO.widget.Column} Column instance.
 617     */
 618
 619    getColumn : function(column) {
 620        if(YAHOO.lang.isNumber(column) && this.keys[column]) {
 621            return this.keys[column];
 622        }
 623        else if(YAHOO.lang.isString(column)) {
 624            var allColumns = this.flat;
 625            var aColumns = [];
 626            for(var i=0; i<allColumns.length; i++) {
 627                if(allColumns[i].key === column) {
 628                    aColumns.push(allColumns[i]);
 629                }
 630            }
 631            if(aColumns.length === 1) {
 632                return aColumns[0];
 633            }
 634            else if(aColumns.length > 1) {
 635                return aColumns;
 636            }
 637        }
 638        return null;
 639    },
 640
 641    /**
 642     * Public accessor returns array of given Column's desendants (if any), including itself.
 643     *
 644     * @method getDescendants
 645     * @parem {YAHOO.widget.Column} Column instance.
 646     * @return {Array} Array including the Column itself and all descendants (if any).
 647     */
 648    getDescendants : function(oColumn) {
 649        var oSelf = this;
 650        var allDescendants = [];
 651        var i;
 652
 653        // Recursive function to loop thru all children
 654        var parse = function(oParent) {
 655            allDescendants.push(oParent);
 656            // This Column has children
 657            if(oParent.children) {
 658                for(i=0; i<oParent.children.length; i++) {
 659                    parse(oSelf.getColumn(oParent.children[i].key));
 660                }
 661            }
 662        };
 663        parse(oColumn);
 664
 665        return allDescendants;
 666    }
 667};
 668
 669/****************************************************************************/
 670/****************************************************************************/
 671/****************************************************************************/
 672
 673/**
 674 * The Column class defines and manages attributes of DataTable Columns
 675 *
 676 * @namespace YAHOO.widget
 677 * @class Column
 678 * @constructor
 679 * @param oConfigs {Object} Object literal of definitions.
 680 */
 681YAHOO.widget.Column = function(oConfigs) {
 682    this._sId = "yui-col" + YAHOO.widget.Column._nCount;
 683    
 684    // Object literal defines Column attributes
 685    if(oConfigs && YAHOO.lang.isObject(oConfigs)) {
 686        for(var sConfig in oConfigs) {
 687            if(sConfig) {
 688                this[sConfig] = oConfigs[sConfig];
 689            }
 690        }
 691    }
 692
 693    // Assign a key if not found
 694    if(!YAHOO.lang.isValue(this.key)) {
 695        this.key = "yui-dt-col" + YAHOO.widget.Column._nCount;
 696    }
 697    
 698    // Assign a field if not found, defaults to key
 699    if(!YAHOO.lang.isValue(this.field)) {
 700        this.field = this.key;
 701    }
 702
 703    // Increment counter
 704    YAHOO.widget.Column._nCount++;
 705
 706    // Backward compatibility
 707    if(this.width && !YAHOO.lang.isNumber(this.width)) {
 708        this.width = null;
 709        YAHOO.log("The Column property width must be a number", "warn", this.toString());
 710    }
 711    if(this.editor && YAHOO.lang.isString(this.editor)) {
 712        this.editor = new YAHOO.widget.CellEditor(this.editor, this.editorOptions);
 713        YAHOO.log("The Column property editor must be an instance of YAHOO.widget.CellEditor", "warn", this.toString());
 714    }
 715};
 716
 717/////////////////////////////////////////////////////////////////////////////
 718//
 719// Private member variables
 720//
 721/////////////////////////////////////////////////////////////////////////////
 722
 723YAHOO.lang.augmentObject(YAHOO.widget.Column, {
 724    /**
 725     * Internal class variable to index multiple Column instances.
 726     *
 727     * @property Column._nCount
 728     * @type Number
 729     * @private
 730     * @static
 731     */
 732    _nCount : 0,
 733
 734    formatCheckbox : function(elCell, oRecord, oColumn, oData) {
 735        YAHOO.log("The method YAHOO.widget.Column.formatCheckbox() has been" +
 736        " deprecated in favor of YAHOO.widget.DataTable.formatCheckbox()", "warn",
 737        "YAHOO.widget.Column.formatCheckbox");
 738        YAHOO.widget.DataTable.formatCheckbox(elCell, oRecord, oColumn, oData);
 739    },
 740
 741    formatCurrency : function(elCell, oRecord, oColumn, oData) {
 742        YAHOO.log("The method YAHOO.widget.Column.formatCurrency() has been" +
 743        " deprecated in favor of YAHOO.widget.DataTable.formatCurrency()", "warn",
 744        "YAHOO.widget.Column.formatCurrency");
 745        YAHOO.widget.DataTable.formatCurrency(elCell, oRecord, oColumn, oData);
 746    },
 747
 748    formatDate : function(elCell, oRecord, oColumn, oData) {
 749        YAHOO.log("The method YAHOO.widget.Column.formatDate() has been" +
 750        " deprecated in favor of YAHOO.widget.DataTable.formatDate()", "warn",
 751        "YAHOO.widget.Column.formatDate");
 752        YAHOO.widget.DataTable.formatDate(elCell, oRecord, oColumn, oData);
 753    },
 754
 755    formatEmail : function(elCell, oRecord, oColumn, oData) {
 756        YAHOO.log("The method YAHOO.widget.Column.formatEmail() has been" +
 757        " deprecated in favor of YAHOO.widget.DataTable.formatEmail()", "warn",
 758        "YAHOO.widget.Column.formatEmail");
 759        YAHOO.widget.DataTable.formatEmail(elCell, oRecord, oColumn, oData);
 760    },
 761
 762    formatLink : function(elCell, oRecord, oColumn, oData) {
 763        YAHOO.log("The method YAHOO.widget.Column.formatLink() has been" +
 764        " deprecated in favor of YAHOO.widget.DataTable.formatLink()", "warn",
 765        "YAHOO.widget.Column.formatLink");
 766        YAHOO.widget.DataTable.formatLink(elCell, oRecord, oColumn, oData);
 767    },
 768
 769    formatNumber : function(elCell, oRecord, oColumn, oData) {
 770        YAHOO.log("The method YAHOO.widget.Column.formatNumber() has been" +
 771        " deprecated in favor of YAHOO.widget.DataTable.formatNumber()", "warn",
 772        "YAHOO.widget.Column.formatNumber");
 773        YAHOO.widget.DataTable.formatNumber(elCell, oRecord, oColumn, oData);
 774    },
 775
 776    formatSelect : function(elCell, oRecord, oColumn, oData) {
 777        YAHOO.log("The method YAHOO.widget.Column.formatSelect() has been" +
 778        " deprecated in favor of YAHOO.widget.DataTable.formatDropdown()", "warn",
 779        "YAHOO.widget.Column.formatSelect");
 780        YAHOO.widget.DataTable.formatDropdown(elCell, oRecord, oColumn, oData);
 781    }
 782});
 783
 784YAHOO.widget.Column.prototype = {
 785    /**
 786     * Unique String identifier assigned at instantiation.
 787     *
 788     * @property _sId
 789     * @type String
 790     * @private
 791     */
 792    _sId : null,
 793
 794    /**
 795     * Reference to Column's current position index within its ColumnSet's keys
 796     * array, if applicable. This property only applies to non-nested and bottom-
 797     * level child Columns.
 798     *
 799     * @property _nKeyIndex
 800     * @type Number
 801     * @private
 802     */
 803    _nKeyIndex : null,
 804
 805    /**
 806     * Reference to Column's current position index within its ColumnSet's tree
 807     * array, if applicable. This property only applies to non-nested and top-
 808     * level parent Columns.
 809     *
 810     * @property _nTreeIndex
 811     * @type Number
 812     * @private
 813     */
 814    _nTreeIndex : null,
 815
 816    /**
 817     * Number of table cells the Column spans.
 818     *
 819     * @property _nColspan
 820     * @type Number
 821     * @private
 822     */
 823    _nColspan : 1,
 824
 825    /**
 826     * Number of table rows the Column spans.
 827     *
 828     * @property _nRowspan
 829     * @type Number
 830     * @private
 831     */
 832    _nRowspan : 1,
 833
 834    /**
 835     * Column's parent Column instance, or null.
 836     *
 837     * @property _oParent
 838     * @type YAHOO.widget.Column
 839     * @private
 840     */
 841    _oParent : null,
 842
 843    /**
 844     * The DOM reference to the associated TH element.
 845     *
 846     * @property _elTh
 847     * @type HTMLElement
 848     * @private
 849     */
 850    _elTh : null,
 851
 852    /**
 853     * The DOM reference to the associated TH element's liner DIV element.
 854     *
 855     * @property _elThLiner
 856     * @type HTMLElement
 857     * @private
 858     */
 859    _elThLiner : null,
 860
 861    /**
 862     * The DOM reference to the associated TH element's label SPAN element.
 863     *
 864     * @property _elThLabel
 865     * @type HTMLElement
 866     * @private
 867     */
 868    _elThLabel : null,
 869
 870    /**
 871     * The DOM reference to the associated resizerelement (if any).
 872     *
 873     * @property _elResizer
 874     * @type HTMLElement
 875     * @private
 876     */
 877    _elResizer : null,
 878
 879    /**
 880     * Internal width tracker.
 881     *
 882     * @property _nWidth
 883     * @type Number
 884     * @private
 885     */
 886    _nWidth : null,
 887
 888    /**
 889     * For unreg() purposes, a reference to the Column's DragDrop instance.
 890     *
 891     * @property _dd
 892     * @type YAHOO.util.DragDrop
 893     * @private
 894     */
 895    _dd : null,
 896
 897    /**
 898     * For unreg() purposes, a reference to the Column resizer's DragDrop instance.
 899     *
 900     * @property _ddResizer
 901     * @type YAHOO.util.DragDrop
 902     * @private
 903     */
 904    _ddResizer : null,
 905
 906    /////////////////////////////////////////////////////////////////////////////
 907    //
 908    // Public member variables
 909    //
 910    /////////////////////////////////////////////////////////////////////////////
 911
 912    /**
 913     * Unique name, required.
 914     *
 915     * @property key
 916     * @type String
 917     */
 918    key : null,
 919
 920    /**
 921     * Associated database field, or null.
 922     *
 923     * @property field
 924     * @type String
 925     */
 926    field : null,
 927
 928    /**
 929     * Text or HTML for display as Column's label in the TH element.
 930     *
 931     * @property label
 932     * @type String
 933     */
 934    label : null,
 935
 936    /**
 937     * Column head cell ABBR for accessibility.
 938     *
 939     * @property abbr
 940     * @type String
 941     */
 942    abbr : null,
 943
 944    /**
 945     * Array of object literals that define children (nested headers) of a Column.
 946     *
 947     * @property children
 948     * @type Object[]
 949     */
 950    children : null,
 951
 952    /**
 953     * Column width (in pixels).
 954     *
 955     * @property width
 956     * @type Number
 957     */
 958    width : null,
 959
 960    /**
 961     * Minimum Column width (in pixels).
 962     *
 963     * @property minWidth
 964     * @type Number
 965     * @default null
 966     */
 967    minWidth : null,
 968
 969    /**
 970     * When a width is not defined for a Column, maxAutoWidth defines an upper
 971     * limit that the Column should be auto-sized to. If resizeable is enabled, 
 972     * users may still resize to a greater width. Most useful for Columns intended
 973     * to hold long unbroken, unwrapped Strings, such as URLs, to prevent very
 974     * wide Columns from disrupting visual readability by inducing truncation.
 975     *
 976     * @property maxAutoWidth
 977     * @type Number
 978     * @default null
 979     */
 980    maxAutoWidth : null,
 981
 982    /**
 983     * True if Column is in hidden state.
 984     *
 985     * @property hidden
 986     * @type Boolean
 987     * @default false     
 988     */
 989    hidden : false,
 990
 991    /**
 992     * True if Column is in selected state.
 993     *
 994     * @property selected
 995     * @type Boolean
 996     * @default false     
 997     */
 998    selected : false,
 999
1000    /**
1001     * Custom CSS class or array of classes to be applied to every cell in the Column.
1002     *
1003     * @property className
1004     * @type String || String[]
1005     */
1006    className : null,
1007
1008    /**
1009     * Defines a format function.
1010     *
1011     * @property formatter
1012     * @type String || HTMLFunction
1013     */
1014    formatter : null,
1015    
1016    /**
1017     * Config passed to YAHOO.util.Number.format() by the 'currency' Column formatter.
1018     *
1019     * @property currencyOptions
1020     * @type Object
1021     * @default null
1022     */
1023    currencyOptions : null,
1024
1025    /**
1026     * Config passed to YAHOO.util.Date.format() by the 'date' Column formatter.
1027     *
1028     * @property dateOptions
1029     * @type Object
1030     * @default null
1031     */
1032    dateOptions : null,
1033
1034    /**
1035     * A CellEditor instance, otherwise Column is not editable.     
1036     *
1037     * @property editor
1038     * @type YAHOO.widget.CellEditor
1039     */
1040    editor : null,
1041
1042    /**
1043     * True if Column is resizeable, false otherwise. The Drag & Drop Utility is
1044     * required to enable this feature. Only bottom-level and non-nested Columns are
1045     * resizeble. 
1046     *
1047     * @property resizeable
1048     * @type Boolean
1049     * @default false
1050     */
1051    resizeable : false,
1052
1053    /**
1054     * True if Column is sortable, false otherwise.
1055     *
1056     * @property sortable
1057     * @type Boolean
1058     * @default false
1059     */
1060    sortable : false,
1061
1062    /**
1063     * @property sortOptions.defaultOrder
1064     * @deprecated Use sortOptions.defaultDir.
1065     */
1066    /**
1067     * Default sort direction for Column: YAHOO.widget.DataTable.CLASS_ASC or YAHOO.widget.DataTable.CLASS_DESC.
1068     *
1069     * @property sortOptions.defaultDir
1070     * @type String
1071     * @default null
1072     */
1073    /**
1074     * Custom field to sort on.
1075     *
1076     * @property sortOptions.field
1077     * @type String
1078     * @default null
1079     */
1080    /**
1081     * Custom sort handler.
1082     *
1083     * @property sortOptions.sortFunction
1084     * @type Function
1085     * @default null
1086     */
1087    sortOptions : null,
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103    /////////////////////////////////////////////////////////////////////////////
1104    //
1105    // Public methods
1106    //
1107    /////////////////////////////////////////////////////////////////////////////
1108
1109    /**
1110     * Returns unique ID string.
1111     *
1112     * @method getId
1113     * @return {String} Unique ID string.
1114     */
1115    getId : function() {
1116        return this._sId;
1117    },
1118
1119    /**
1120     * Column instance name, for logging.
1121     *
1122     * @method toString
1123     * @return {String} Column's unique name.
1124     */
1125    toString : function() {
1126        return "Column instance " + this._sId;
1127    },
1128
1129    /**
1130     * Returns object literal definition.
1131     *
1132     * @method getDefinition
1133     * @return {Object} Object literal definition.
1134     */
1135    getDefinition : function() {
1136        var oDefinition = {};
1137        
1138        // Update the definition
1139        oDefinition.abbr = this.abbr;
1140        oDefinition.className = this.className;
1141        oDefinition.editor = this.editor;
1142        oDefinition.editorOptions = this.editorOptions; //TODO: deprecated
1143        oDefinition.field = this.field;
1144        oDefinition.formatter = this.formatter;
1145        oDefinition.hidden = this.hidden;
1146        oDefinition.key = this.key;
1147        oDefinition.label = this.label;
1148        oDefinition.minWidth = this.minWidth;
1149        oDefinition.maxAutoWidth = this.maxAutoWidth;
1150        oDefinition.resizeable = this.resizeable;
1151        oDefinition.selected = this.selected;
1152        oDefinition.sortable = this.sortable;
1153        oDefinition.sortOptions = this.sortOptions;
1154        oDefinition.width = this.width;
1155
1156        return oDefinition;
1157    },
1158
1159    /**
1160     * Returns unique Column key.
1161     *
1162     * @method getKey
1163     * @return {String} Column key.
1164     */
1165    getKey : function() {
1166        return this.key;
1167    },
1168    
1169    /**
1170     * Returns field.
1171     *
1172     * @method getField
1173     * @return {String} Column field.
1174     */
1175    getField : function() {
1176        return this.field;
1177    },
1178    
1179    /**
1180     * Returns Column key which has been sanitized for DOM (class and ID) usage
1181     * starts with letter, contains only letters, numbers, hyphen, or period.
1182     *
1183     * @method getSanitizedKey
1184     * @return {String} Sanitized Column key.
1185     */
1186    getSanitizedKey : function() {
1187        return this.getKey().replace(/[^\w\-]/g,"");
1188    },
1189
1190    /**
1191     * Public accessor returns Column's current position index within its
1192     * ColumnSet's keys array, if applicable. Only non-nested and bottom-level
1193     * child Columns will return a value.
1194     *
1195     * @method getKeyIndex
1196     * @return {Number} Position index, or null.
1197     */
1198    getKeyIndex : function() {
1199        return this._nKeyIndex;
1200    },
1201
1202    /**
1203     * Public accessor returns Column's current position index within its
1204     * ColumnSet's tree array, if applicable. Only non-nested and top-level parent
1205     * Columns will return a value;
1206     *
1207     * @method getTreeIndex
1208     * @return {Number} Position index, or null.
1209     */
1210    getTreeIndex : function() {
1211        return this._nTreeIndex;
1212    },
1213
1214    /**
1215     * Public accessor returns Column's parent instance if any, or null otherwise.
1216     *
1217     * @method getParent
1218     * @return {YAHOO.widget.Column} Column's parent instance.
1219     */
1220    getParent : function() {
1221        return this._oParent;
1222    },
1223
1224    /**
1225     * Public accessor returns Column's calculated COLSPAN value.
1226     *
1227     * @method getColspan
1228     * @return {Number} Column's COLSPAN value.
1229     */
1230    getColspan : function() {
1231        return this._nColspan;
1232    },
1233    // Backward compatibility
1234    getColSpan : function() {
1235        YAHOO.log("The method getColSpan() has been" +
1236        " deprecated in favor of getColspan()", "warn", this.toString());
1237        return this.getColspan();
1238    },
1239
1240    /**
1241     * Public accessor returns Column's calculated ROWSPAN value.
1242     *
1243     * @method getRowspan
1244     * @return {Number} Column's ROWSPAN value.
1245     */
1246    getRowspan : function() {
1247        return this._nRowspan;
1248    },
1249
1250    /**
1251     * Returns DOM reference to the key TH element.
1252     *
1253     * @method getThEl
1254     * @return {HTMLElement} TH element.
1255     */
1256    getThEl : function() {
1257        return this._elTh;
1258    },
1259
1260    /**
1261     * Returns DOM reference to the TH's liner DIV element. Introduced since
1262     * resizeable Columns may have an extra resizer liner, making the DIV liner
1263     * not reliably the TH element's first child.               
1264     *
1265     * @method getThLInerEl
1266     * @return {HTMLElement} TH element.
1267     */
1268    getThLinerEl : function() {
1269        return this._elThLiner;
1270    },
1271    
1272    /**
1273     * Returns DOM reference to the resizer element, or null.
1274     *
1275     * @method getResizerEl
1276     * @return {HTMLElement} DIV element.
1277     */
1278    getResizerEl : function() {
1279        return this._elResizer;
1280    },
1281
1282    // Backward compatibility
1283    /**
1284     * @method getColEl
1285     * @deprecated Use getThEl
1286     */
1287    getColEl : function() {
1288        YAHOO.log("The method getColEl() has been" +
1289        " deprecated in favor of getThEl()", "warn",
1290        this.toString());
1291        return this.getThEl();
1292    },
1293    getIndex : function() {
1294        YAHOO.log("The method getIndex() has been" +
1295        " deprecated in favor of getKeyIndex()", "warn",
1296        this.toString());
1297        return this.getKeyIndex();
1298    },
1299    format : function() {
1300        YAHOO.log("The method format() has been deprecated in favor of the " +
1301        "DataTable method formatCell()", "error", this.toString());
1302    }
1303};
1304
1305/****************************************************************************/
1306/****************************************************************************/
1307/****************************************************************************/
1308
1309/**
1310 * Sort static utility to support Column sorting.
1311 *
1312 * @namespace YAHOO.util
1313 * @class Sort
1314 * @static
1315 */
1316YAHOO.util.Sort = {
1317    /////////////////////////////////////////////////////////////////////////////
1318    //
1319    // Public methods
1320    //
1321    /////////////////////////////////////////////////////////////////////////////
1322
1323    /**
1324     * Comparator function for simple case-insensitive string sorting.
1325     *
1326     * @method compare
1327     * @param a {Object} First sort argument.
1328     * @param b {Object} Second sort argument.
1329     * @param desc {Boolean} True if sort direction is descending, false if
1330     * sort direction is ascending.
1331     */
1332    compare: function(a, b, desc) {
1333        if((a === null) || (typeof a == "undefined")) {
1334            if((b === null) || (typeof b == "undefined")) {
1335                return 0;
1336            }
1337            else {
1338                return 1;
1339            }
1340        }
1341        else if((b === null) || (typeof b == "undefined")) {
1342            return -1;
1343        }
1344
1345        if(a.constructor == String) {
1346            a = a.toLowerCase();
1347        }
1348        if(b.constructor == String) {
1349            b = b.toLowerCase();
1350        }
1351        if(a < b) {
1352            return (desc) ? 1 : -1;
1353        }
1354        else if (a > b) {
1355            return (desc) ? -1 : 1;
1356        }
1357        else {
1358            return 0;
1359        }
1360    }
1361};
1362
1363/****************************************************************************/
1364/****************************************************************************/
1365/****************************************************************************/
1366
1367/**
1368 * ColumnDD subclasses DragDrop to support rearrangeable Columns.
1369 *
1370 * @namespace YAHOO.util
1371 * @class ColumnDD
1372 * @extends YAHOO.util.DDProxy
1373 * @constructor
1374 * @param oDataTable {YAHOO.widget.DataTable} DataTable instance.
1375 * @param oColumn {YAHOO.widget.Column} Column instance.
1376 * @param elTh {HTMLElement} TH element reference.
1377 * @param elTarget {HTMLElement} Drag target element.
1378 */
1379YAHOO.widget.ColumnDD = function(oDataTable, oColumn, elTh, elTarget) {
1380    if(oDataTable && oColumn && elTh && elTarget) {
1381        this.datatable = oDataTable;
1382        this.table = oDataTable.getTableEl();
1383        this.column = oColumn;
1384        this.headCell = elTh;
1385        this.pointer = elTarget;
1386        this.newIndex = null;
1387        this.init(elTh);
1388        this.initFrame(); // Needed for DDProxy
1389        this.invalidHandleTypes = {};
1390
1391        // Set top/bottom padding to account for children of nested columns
1392        this.setPadding(10, 0, (this.datatable.getTheadEl().offsetHeight + 10) , 0);
1393
1394        YAHOO.util.Event.on(window, 'resize', function() {
1395            this.initConstraints();
1396        }, this, true);
1397    }
1398    else {
1399        YAHOO.log("Column dragdrop could not be created","warn",oDataTable.toString());
1400    }
1401};
1402
1403if(YAHOO.util.DDProxy) {
1404    YAHOO.extend(YAHOO.widget.ColumnDD, YAHOO.util.DDProxy, {
1405        initConstraints: function() {
1406            //Get the top, right, bottom and left positions
1407            var region = YAHOO.util.Dom.getRegion(this.table),
1408                //Get the element we are working on
1409                el = this.getEl(),
1410                //Get the xy position of it
1411                xy = YAHOO.util.Dom.getXY(el),
1412                //Get the width and height
1413                width = parseInt(YAHOO.util.Dom.getStyle(el, 'width'), 10),
1414                height = parseInt(YAHOO.util.Dom.getStyle(el, 'height'), 10),
1415                //Set left to x minus left
1416                left = ((xy[0] - region.left) + 15), //Buffer of 15px
1417                //Set right to right minus x minus width
1418                right = ((region.right - xy[0] - width) + 15);
1419    
1420            //Set the constraints based on the above calculations
1421            this.setXConstraint(left, right);
1422            this.setYConstraint(10, 10);            
1423        },
1424        _resizeProxy: function() {
1425            this.constructor.superclass._resizeProxy.apply(this, arguments);
1426            var dragEl = this.getDragEl(),
1427                el = this.getEl();
1428
1429            YAHOO.util.Dom.setStyle(this.pointer, 'height', (this.table.parentNode.offsetHeight + 10) + 'px');
1430            YAHOO.util.Dom.setStyle(this.pointer, 'display', 'block');
1431            var xy = YAHOO.util.Dom.getXY(el);
1432            YAHOO.util.Dom.setXY(this.pointer, [xy[0], (xy[1] - 5)]);
1433            
1434            YAHOO.util.Dom.setStyle(dragEl, 'height', this.datatable.getContainerEl().offsetHeight + "px");
1435            YAHOO.util.Dom.setStyle(dragEl, 'width', (parseInt(YAHOO.util.Dom.getStyle(dragEl, 'width'),10) + 4) + 'px');
1436            YAHOO.util.Dom.setXY(this.dragEl, xy);
1437        },
1438        onMouseDown: function() {
1439                this.initConstraints();
1440                this.resetConstraints();
1441        },
1442        clickValidator: function(e) {
1443            if(!this.column.hidden) {
1444                var target = YAHOO.util.Event.getTarget(e);
1445                return ( this.isValidHandleChild(target) &&
1446                            (this.id == this.handleElId ||
1447                                this.DDM.handleWasClicked(target, this.id)) );
1448            }
1449        },
1450        onDragOver: function(ev, id) {
1451            // Validate target as a Column
1452            var target = this.datatable.getColumn(id);
1453            if(target) {                
1454                // Validate target as a top-level parent
1455                var targetIndex = target.getTreeIndex();
1456                while((targetIndex === null) && target.getParent()) {
1457                    target = target.getParent();
1458                    targetIndex = target.getTreeIndex();
1459                }
1460                if(targetIndex !== null) {
1461                    // Are we placing to left or right of target?
1462                    var elTarget = target.getThEl();
1463                    var newIndex = targetIndex;
1464                    var mouseX = YAHOO.util.Event.getPageX(ev),
1465                        targetX = YAHOO.util.Dom.getX(elTarget),
1466                        midX = targetX + ((YAHOO.util.Dom.get(elTarget).offsetWidth)/2),
1467                        currentIndex =  this.column.getTreeIndex();
1468                    
1469                    if (mouseX < midX) {
1470                       YAHOO.util.Dom.setX(this.pointer, targetX);
1471                    } else {
1472                        var targetWidth = parseInt(elTarget.offsetWidth, 10);
1473                        YAHOO.util.Dom.setX(this.pointer, (targetX + targetWidth));
1474                        newIndex++;
1475                    }
1476                    if (targetIndex > currentIndex) {
1477                        newIndex--;
1478                    }
1479                    if(newIndex < 0) {
1480                        newIndex = 0;
1481                    }
1482                    else if(newIndex > this.datatable.getColumnSet().tree[0].length) {
1483                        newIndex = this.datatable.getColumnSet().tree[0].length;
1484                    }
1485                    this.newIndex = newIndex;
1486                }
1487            }
1488        },
1489        onDragDrop: function() {
1490            this.datatable.reorderColumn(this.column, this.newIndex);
1491        },
1492        endDrag: function() {
1493            this.newIndex = null;
1494            YAHOO.util.Dom.setStyle(this.pointer, 'display', 'none');
1495        }
1496    });
1497}
1498
1499/****************************************************************************/
1500/****************************************************************************/
1501/****************************************************************************/
1502
1503/**
1504 * ColumnResizer subclasses DragDrop to support resizeable Columns.
1505 *
1506 * @namespace YAHOO.util
1507 * @class ColumnResizer
1508 * @extends YAHOO.util.DDProxy
1509 * @constructor
1510 * @param oDataTable {YAHOO.widget.DataTable} DataTable instance.
1511 * @param oColumn {YAHOO.widget.Column} Column instance.
1512 * @param elTh {HTMLElement} TH element reference.
1513 * @param sHandleElId {String} DOM ID of the handle element that causes the resize.
1514 * @param elProxy {HTMLElement} Resizer proxy element.
1515 */
1516YAHOO.util.ColumnResizer = function(oDataTable, oColumn, elTh, sHandleId, elProxy) {
1517    if(oDataTable && oColumn && elTh && sHandleId) {
1518        this.datatable = oDataTable;
1519        this.column = oColumn;
1520        this.headCell = elTh;
1521        this.headCellLiner = oColumn.getThLinerEl();
1522        this.resizerLiner = elTh.firstChild;
1523        this.init(sHandleId, sHandleId, {dragOnly:true, dragElId: elProxy.id});
1524        this.initFrame(); // Needed for proxy
1525        this.resetResizerEl(); // Needed when rowspan > 0
1526
1527        // Set right padding for bug 1858462
1528        this.setPadding(0, 1, 0, 0);
1529    }
1530    else {
1531        YAHOO.log("Column resizer could not be created","warn",oDataTable.toString());
1532    }
1533};
1534
1535if(YAHOO.util.DD) {
1536    YAHOO.extend(YAHOO.util.ColumnResizer, YAHOO.util.DDProxy, {
1537        /////////////////////////////////////////////////////////////////////////////
1538        //
1539        // Public methods
1540        //
1541        /////////////////////////////////////////////////////////////////////////////
1542        /**
1543         * Resets resizer element.
1544         *
1545         * @method resetResizerEl
1546         */
1547        resetResizerEl : function() {
1548            var resizerStyle = YAHOO.util.Dom.get(this.handleElId).style;
1549            resizerStyle.left = "auto";
1550            resizerStyle.right = 0;
1551            resizerStyle.top = "auto";
1552            resizerStyle.bottom = 0;
1553            resizerStyle.height = this.headCell.offsetHeight+"px";
1554        },
1555    
1556        /////////////////////////////////////////////////////////////////////////////
1557        //
1558        // Public DOM event handlers
1559      

Large files files are truncated, but you can click here to view the full file