Upgrade to ExtJS 3.1.0 - Released 12/16/2009
[extjs.git] / examples / ux / treegrid / TreeGridColumns.js
1 /*!
2  * Ext JS Library 3.1.0
3  * Copyright(c) 2006-2009 Ext JS, LLC
4  * licensing@extjs.com
5  * http://www.extjs.com/license
6  */
7 (function() {    
8     Ext.override(Ext.list.Column, {
9         init : function() {            
10             if(!this.type){
11                 this.type = "auto";
12             }
13
14             var st = Ext.data.SortTypes;
15             // named sortTypes are supported, here we look them up
16             if(typeof this.sortType == "string"){
17                 this.sortType = st[this.sortType];
18             }
19
20             // set default sortType for strings and dates
21             if(!this.sortType){
22                 switch(this.type){
23                     case "string":
24                         this.sortType = st.asUCString;
25                         break;
26                     case "date":
27                         this.sortType = st.asDate;
28                         break;
29                     default:
30                         this.sortType = st.none;
31                 }
32             }
33         }
34     });
35
36     Ext.tree.Column = Ext.extend(Ext.list.Column, {});
37     Ext.tree.NumberColumn = Ext.extend(Ext.list.NumberColumn, {});
38     Ext.tree.DateColumn = Ext.extend(Ext.list.DateColumn, {});
39     Ext.tree.BooleanColumn = Ext.extend(Ext.list.BooleanColumn, {});
40
41     Ext.reg('tgcolumn', Ext.tree.Column);
42     Ext.reg('tgnumbercolumn', Ext.tree.NumberColumn);
43     Ext.reg('tgdatecolumn', Ext.tree.DateColumn);
44     Ext.reg('tgbooleancolumn', Ext.tree.BooleanColumn);
45 })();