X-Git-Url: http://git.ithinksw.org/extjs.git/blobdiff_plain/2e847cf21b8ab9d15fa167b315ca5b2fa92638fc..0494b8d9b9bb03ab6c22b34dae81261e3cd7e3e6:/examples/ux/treegrid/TreeGridColumns.js diff --git a/examples/ux/treegrid/TreeGridColumns.js b/examples/ux/treegrid/TreeGridColumns.js index ea2732c5..3671c143 100644 --- a/examples/ux/treegrid/TreeGridColumns.js +++ b/examples/ux/treegrid/TreeGridColumns.js @@ -1,34 +1,28 @@ /*! - * Ext JS Library 3.1.1 - * Copyright(c) 2006-2010 Ext JS, LLC - * licensing@extjs.com - * http://www.extjs.com/license + * Ext JS Library 3.3.1 + * Copyright(c) 2006-2010 Sencha Inc. + * licensing@sencha.com + * http://www.sencha.com/license */ -(function() { +(function() { Ext.override(Ext.list.Column, { - init : function() { - if(!this.type){ - this.type = "auto"; + init : function() { + var types = Ext.data.Types, + st = this.sortType; + + if(this.type){ + if(Ext.isString(this.type)){ + this.type = Ext.data.Types[this.type.toUpperCase()] || types.AUTO; + } + }else{ + this.type = types.AUTO; } - var st = Ext.data.SortTypes; // named sortTypes are supported, here we look them up - if(typeof this.sortType == "string"){ - this.sortType = st[this.sortType]; - } - - // set default sortType for strings and dates - if(!this.sortType){ - switch(this.type){ - case "string": - this.sortType = st.asUCString; - break; - case "date": - this.sortType = st.asDate; - break; - default: - this.sortType = st.none; - } + if(Ext.isString(st)){ + this.sortType = Ext.data.SortTypes[st]; + }else if(Ext.isEmpty(st)){ + this.sortType = this.type.sortType; } } });