TreeGridColumns.js
上传用户:dawnssy
上传日期:2022-08-06
资源大小:9345k
文件大小:1k
源码类别:

JavaScript

开发平台:

JavaScript

  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.             var st = Ext.data.SortTypes;
  14.             // named sortTypes are supported, here we look them up
  15.             if(typeof this.sortType == "string"){
  16.                 this.sortType = st[this.sortType];
  17.             }
  18.             // set default sortType for strings and dates
  19.             if(!this.sortType){
  20.                 switch(this.type){
  21.                     case "string":
  22.                         this.sortType = st.asUCString;
  23.                         break;
  24.                     case "date":
  25.                         this.sortType = st.asDate;
  26.                         break;
  27.                     default:
  28.                         this.sortType = st.none;
  29.                 }
  30.             }
  31.         }
  32.     });
  33.     Ext.tree.Column = Ext.extend(Ext.list.Column, {});
  34.     Ext.tree.NumberColumn = Ext.extend(Ext.list.NumberColumn, {});
  35.     Ext.tree.DateColumn = Ext.extend(Ext.list.DateColumn, {});
  36.     Ext.tree.BooleanColumn = Ext.extend(Ext.list.BooleanColumn, {});
  37.     Ext.reg('tgcolumn', Ext.tree.Column);
  38.     Ext.reg('tgnumbercolumn', Ext.tree.NumberColumn);
  39.     Ext.reg('tgdatecolumn', Ext.tree.DateColumn);
  40.     Ext.reg('tgbooleancolumn', Ext.tree.BooleanColumn);
  41. })();