sync
[roojs1] / roojs-bootstrap-debug.js
index ebf8d04..5f0d872 100644 (file)
@@ -392,7 +392,7 @@ Roo.extend(Roo.bootstrap.Component, Roo.BoxComponent,  {
 
 Roo.bootstrap.Body = function(config){
     Roo.bootstrap.Body.superclass.constructor.call(this, config);
-    this.el = Roo.get(document.body);
+    this.el = Roo.get(config.el ? config.el : document.body );
     if (this.cls && this.cls.length) {
         Roo.get(document.body).addClass(this.cls);
     }
@@ -1513,7 +1513,19 @@ Roo.extend(Roo.bootstrap.Img, Roo.bootstrap.Component,  {
     {
         Roo.log('img onclick');
         this.fireEvent('click', this, e);
+    },
+    /**
+     * Sets the url of the image - used to update it
+     * @param {String} url the url of the image
+     */
+    
+    setSrc : function(url)
+    {
+        this.src =  url;
+        this.el.select('img', true).first().dom.src =  url;
     }
+    
+    
    
 });
 
@@ -2150,14 +2162,7 @@ Roo.extend(Roo.bootstrap.Menu, Roo.bootstrap.Component,  {
             xy[0] = xy[0] - this.el.getWidth() + this.triggerEl.getWidth();
         }
         
-        /*
-         * This not working on ios
-         */
-//        if(this.el.getStyle('top').slice(-1) != "%"){
-//            this.el.setXY(xy);
-//        }
-        
-        if(!isNaN(this.el.getStyle('top') * 1)){
+        if(this.el.getStyle('top') != 'auto' && this.el.getStyle('top').slice(-1) != "%"){
             this.el.setXY(xy);
         }
         
@@ -2463,7 +2468,8 @@ Roo.extend(Roo.bootstrap.MenuSeparator, Roo.bootstrap.Component,  {
  * @cfg {String} buttonPosition (left|right|center) default right
  * @cfg {Boolean} animate default true
  * @cfg {Boolean} allow_close default true
- * @cfg {Boolean} fitwindow default true
+ * @cfg {Boolean} fitwindow default false
+ * @cfg {String} size (sm|lg) default empty
  * 
  * 
  * @constructor
@@ -2520,6 +2526,8 @@ Roo.extend(Roo.bootstrap.Modal, Roo.bootstrap.Component,  {
     titleEl:  false,
     closeEl:  false,
     
+    size: '',
+    
     
     onRender : function(ct, position)
     {
@@ -2626,14 +2634,21 @@ Roo.extend(Roo.bootstrap.Modal, Roo.bootstrap.Component,  {
                 html : '&times'
             });
         }
+        
         header.push(title);
         
+        var size = '';
+        
+        if(this.size.length){
+            size = 'modal-' + this.size;
+        }
+        
         var modal = {
             cls: "modal",
             style : 'display: none',
             cn : [
                 {
-                    cls: "modal-dialog",
+                    cls: "modal-dialog " + size,
                     cn : [
                         {
                             cls : "modal-content",
@@ -2695,8 +2710,8 @@ Roo.extend(Roo.bootstrap.Modal, Roo.bootstrap.Component,  {
         this.maskEl.setSize(Roo.lib.Dom.getViewWidth(true),  Roo.lib.Dom.getViewHeight(true));
         if (this.fitwindow) {
             var w = this.width || Roo.lib.Dom.getViewportWidth(true) - 30;
-            var h = this.height || Roo.lib.Dom.getViewportHeight(true) - 30;
-            this.setSize(w,h)
+            var h = this.height || Roo.lib.Dom.getViewportHeight(true) - 60;
+            this.setSize(w,h);
         }
     },
     
@@ -2737,13 +2752,15 @@ Roo.extend(Roo.bootstrap.Modal, Roo.bootstrap.Component,  {
         this.el.setStyle('zIndex', '10001');
        
         this.fireEvent('show', this);
-        this.items.forEach(function(e) {
-            e.layout ? e.layout() : false;
-                
-        });
-        this.resize();
         
+        this.resize();
         
+        (function () {
+            this.items.forEach( function(e) {
+                e.layout ? e.layout() : false;
+                    
+            });
+        }).defer(100,this);
         
     },
     hide : function()
@@ -5705,17 +5722,19 @@ Roo.bootstrap.Table = function(config){
   
     
     // BC...
-    this.rowSelection = (typeof(config.RowSelection) != 'undefined') ? config.RowSelection : this.rowSelection;
-    this.cellSelection = (typeof(config.CellSelection) != 'undefined') ? config.CellSelection : this.cellSelection;
+    this.rowSelection = (typeof(config.rowSelection) != 'undefined') ? config.rowSelection : this.rowSelection;
+    this.cellSelection = (typeof(config.cellSelection) != 'undefined') ? config.cellSelection : this.cellSelection;
     this.headerShow = (typeof(config.thead) != 'undefined') ? config.thead : this.headerShow;
     this.footerShow = (typeof(config.tfoot) != 'undefined') ? config.tfoot : this.footerShow;
     
-    
+    this.sm = this.sm || {xtype: 'RowSelectionModel'};
     if (this.sm) {
+        this.sm.grid = this;
         this.selModel = Roo.factory(this.sm, Roo.bootstrap.Table);
         this.sm = this.selModel;
         this.sm.xmodule = this.xmodule || false;
     }
+    
     if (this.cm && typeof(this.cm.config) == 'undefined') {
         this.colModel = new Roo.grid.ColumnModel(this.cm);
         this.cm = this.colModel;
@@ -5967,6 +5986,10 @@ Roo.extend(Roo.bootstrap.Table, Roo.bootstrap.Component,  {
         if(!this.store || !this.cm){
             return;
         }
+        if (this.selModel) {
+            this.selModel.initEvents();
+        }
+        
         
         //Roo.log('initEvents with ds!!!!');
         
@@ -5975,6 +5998,7 @@ Roo.extend(Roo.bootstrap.Table, Roo.bootstrap.Component,  {
         
         
         
+        
         var _this = this;
         
         Roo.each(this.el.select('thead th.sortable', true).elements, function(e){
@@ -5991,7 +6015,7 @@ Roo.extend(Roo.bootstrap.Table, Roo.bootstrap.Component,  {
         if (this.footer) {
             this.footer.parentId = this.id;
             this.footer.onRender(this.el.select('tfoot tr td').first(), null);        
-        }
+        } 
         
         this.maskEl = new Roo.LoadMask(this.el, { store : this.ds, msgCls: 'roo-el-mask-msg' });
         
@@ -5999,6 +6023,7 @@ Roo.extend(Roo.bootstrap.Table, Roo.bootstrap.Component,  {
         this.store.on('beforeload', this.onBeforeLoad, this);
         this.store.on('update', this.onUpdate, this);
         this.store.on('add', this.onAdd, this);
+        this.store.on("clear", this.clear, this);
         
         this.el.on("contextmenu", this.onContextMenu, this);
         
@@ -6150,12 +6175,12 @@ Roo.extend(Roo.bootstrap.Table, Roo.bootstrap.Component,  {
         
         
     },
-    
+        
     onDblClick : function(e,el)
     {
         var cell = Roo.get(el);
         
-        if(!cell || (!this.CellSelection && !this.RowSelection)){
+        if(!cell || (!this.cellSelection && !this.rowSelection)){
             return;
         }
         
@@ -6176,11 +6201,11 @@ Roo.extend(Roo.bootstrap.Table, Roo.bootstrap.Component,  {
         var cellIndex = cell.dom.cellIndex;
         var rowIndex = this.getRowIndex(row);
         
-        if(this.CellSelection){
+        if(this.cellSelection){
             this.fireEvent('celldblclick', this, cell, rowIndex, cellIndex, e);
         }
         
-        if(this.RowSelection){
+        if(this.rowSelection){
             this.fireEvent('rowdblclick', this, row, rowIndex, e);
         }
     },
@@ -6415,6 +6440,7 @@ Roo.extend(Roo.bootstrap.Table, Roo.bootstrap.Component,  {
     onUpdate : function(ds,record)
     {
         this.refreshRow(record);
+        this.autoSize();
     },
     
     onRemove : function(ds, record, index, isUpdate){
@@ -6466,7 +6492,9 @@ Roo.extend(Roo.bootstrap.Table, Roo.bootstrap.Component,  {
             index = ds.indexOf(record);
         }
         this.insertRow(ds, index, true);
+        this.autoSize();
         this.onRemove(ds, record, index+1, true);
+        this.autoSize();
         //this.syncRowHeights(index, index);
         //this.layout();
         this.fireEvent("rowupdated", this, index, record);
@@ -6651,7 +6679,7 @@ Roo.extend(Roo.bootstrap.Table, Roo.bootstrap.Component,  {
     
     getSelectionModel : function(){
         if(!this.selModel){
-            this.selModel = new Roo.bootstrap.Table.RowSelectionModel();
+            this.selModel = new Roo.bootstrap.Table.RowSelectionModel({grid: this});
         }
         return this.selModel;
     },
@@ -6700,24 +6728,28 @@ Roo.extend(Roo.bootstrap.Table, Roo.bootstrap.Component,  {
      * Forces a resize - used by panel.Grid
      * @return {Element} The element
      */
-    autoSize : function(){
+    autoSize : function()
+    {
         //var ctr = Roo.get(this.container.dom.parentElement);
         var ctr = Roo.get(this.el.dom);
         
         var thd = this.getGridEl().select('thead',true).first();
         var tbd = this.getGridEl().select('tbody', true).first();
-        
+        var tfd = this.getGridEl().select('tfoot', true).first();
         
         var cw = ctr.getWidth();
         
         if (tbd) {
             
-            tbd.setSize(ctr.getWidth(), ctr.getHeight() - thd.getHeight());
+            tbd.setSize(ctr.getWidth(),
+                        ctr.getHeight() - (thd.getHeight() + (tfd ? tfd.getHeight() : 0))
+            );
             var barsize = (tbd.dom.offsetWidth - tbd.dom.clientWidth);
             cw -= barsize;
         }
         cw = Math.max(cw, this.totalWidth);
         this.getGridEl().select('tr',true).setWidth(cw);
+        // resize 'expandable coloumn?
         
         return; // we doe not have a view in this design..
         
@@ -8005,6 +8037,7 @@ Roo.form.VTypes = function(){
  * @cfg {String} labelAlign (top|left)
  * @cfg {Boolean} readOnly Specifies that the field should be read-only
  * @cfg {String} autocomplete - default is new-password see: https://developers.google.com/web/fundamentals/input/form/label-and-name-inputs?hl=en
+ * @cfg {String} indicatorpos (left|right) default left
 
  * @cfg {String} align (left|center|right) Default left
  * @cfg {Boolean} forceFeedback (true|false) Default false
@@ -8206,6 +8239,8 @@ Roo.extend(Roo.bootstrap.Input, Roo.bootstrap.Component,  {
     formatedValue : false,
     forceFeedback : false,
     
+    indicatorpos : 'left',
+    
     parentLabelAlign : function()
     {
         var parent = this;
@@ -8219,16 +8254,14 @@ Roo.extend(Roo.bootstrap.Input, Roo.bootstrap.Component,  {
         
     },
     
-    getAutoCreate : function(){
-        
+    getAutoCreate : function()
+    {
         var align = (!this.labelAlign) ? this.parentLabelAlign() : this.labelAlign;
         
         var id = Roo.id();
         
         var cfg = {};
         
-       
-        
         if(this.inputType != 'hidden'){
             cfg.cls = 'form-group' //input-group
         }
@@ -8243,7 +8276,6 @@ Roo.extend(Roo.bootstrap.Input, Roo.bootstrap.Component,  {
             autocomplete : this.autocomplete || 'new-password'
         };
         
-        
         if(this.align){
             input.style = (typeof(input.style) == 'undefined') ? ('text-align:' + this.align) : (input.style + 'text-align:' + this.align);
         }
@@ -8263,9 +8295,11 @@ Roo.extend(Roo.bootstrap.Input, Roo.bootstrap.Component,  {
         if (this.name) {
             input.name = this.name;
         }
+        
         if (this.size) {
             input.cls += ' input-' + this.size;
         }
+        
         var settings=this;
         ['xs','sm','md','lg'].map(function(size){
             if (settings[size]) {
@@ -8342,15 +8376,42 @@ Roo.extend(Roo.bootstrap.Input, Roo.bootstrap.Component,  {
         };
         
         if (align ==='left' && this.fieldLabel.length) {
-                
+            
+            cfg.cn = [
+                {
+                    tag : 'i',
+                    cls : 'roo-required-indicator left-indicator text-danger fa fa-lg fa-star',
+                    tooltip : 'This field is required'
+                },
+                {
+                    tag: 'label',
+                    'for' :  id,
+                    cls : 'control-label col-sm-' + this.labelWidth,
+                    html : this.fieldLabel
+
+                },
+                {
+                    cls : "col-sm-" + (12 - this.labelWidth), 
+                    cn: [
+                        inputblock
+                    ]
+                }
+
+            ];
+            
+            if(this.indicatorpos == 'right'){
                 cfg.cn = [
-                    
                     {
                         tag: 'label',
                         'for' :  id,
                         cls : 'control-label col-sm-' + this.labelWidth,
                         html : this.fieldLabel
-                        
+
+                    },
+                    {
+                        tag : 'i',
+                        cls : 'roo-required-indicator right-indicator text-danger fa fa-lg fa-star',
+                        tooltip : 'This field is required'
                     },
                     {
                         cls : "col-sm-" + (12 - this.labelWidth), 
@@ -8358,30 +8419,57 @@ Roo.extend(Roo.bootstrap.Input, Roo.bootstrap.Component,  {
                             inputblock
                         ]
                     }
-                    
+
                 ];
+            }
+            
         } else if ( this.fieldLabel.length) {
                 
-                 cfg.cn = [
-                   
+            cfg.cn = [
+                {
+                    tag : 'i',
+                    cls : 'roo-required-indicator left-indicator text-danger fa fa-lg fa-star',
+                    tooltip : 'This field is required'
+                },
+                {
+                    tag: 'label',
+                   //cls : 'input-group-addon',
+                    html : this.fieldLabel
+
+                },
+
+               inputblock
+
+           ];
+           
+           if(this.indicatorpos == 'right'){
+                
+                cfg.cn = [
                     {
                         tag: 'label',
-                        //cls : 'input-group-addon',
+                       //cls : 'input-group-addon',
                         html : this.fieldLabel
-                        
+
                     },
-                    
-                    inputblock
-                    
-                ];
+                    {
+                        tag : 'i',
+                        cls : 'roo-required-indicator right-indicator text-danger fa fa-lg fa-star',
+                        tooltip : 'This field is required'
+                    },
+
+                   inputblock
+
+               ];
+
+            }
 
         } else {
             
-                cfg.cn = [
-                    
-                        inputblock
-                    
-                ];
+            cfg.cn = [
+
+                    inputblock
+
+            ];
                 
                 
         };
@@ -8389,10 +8477,12 @@ Roo.extend(Roo.bootstrap.Input, Roo.bootstrap.Component,  {
         if (this.parentType === 'Navbar' &&  this.parent().bar) {
            cfg.cls += ' navbar-form';
         }
+        
         if (this.parentType === 'NavGroup') {
            cfg.cls += ' navbar-form';
            cfg.tag = 'li';
         }
+        
         return cfg;
         
     },
@@ -8409,6 +8499,18 @@ Roo.extend(Roo.bootstrap.Input, Roo.bootstrap.Component,  {
         return this.inputEl();
     },
     
+    indicatorEl : function()
+    {
+        var indicator = this.el.select('i.roo-required-indicator',true).first();
+        
+        if(!indicator){
+            return false;
+        }
+        
+        return indicator;
+        
+    },
+    
     setDisabled : function(v)
     {
         var i  = this.inputEl().dom;
@@ -8427,6 +8529,13 @@ Roo.extend(Roo.bootstrap.Input, Roo.bootstrap.Component,  {
         this.inputEl().on("blur", this.onBlur,  this);
         
         this.inputEl().relayEvent('keyup', this);
+        
+        this.indicator = this.indicatorEl();
+        
+        if(this.indicator){
+            this.indicator.setVisibilityMode(Roo.Element.DISPLAY);
+            this.indicator.hide();
+        }
  
         // reference to original value for reset
         this.originalValue = this.getValue();
@@ -8445,6 +8554,8 @@ Roo.extend(Roo.bootstrap.Input, Roo.bootstrap.Component,  {
         }
         if(this.maskRe || (this.vtype && this.disableKeyFilter !== true && (this.maskRe = Roo.form.VTypes[this.vtype+'Mask']))){
             this.inputEl().on("keypress", this.filterKeys, this);
+        } else {
+            this.inputEl().relayEvent('keypress', this);
         }
        /* if(this.grow){
             this.el.on("keyup", this.onKeyUp,  this, {buffer:50});
@@ -8686,11 +8797,8 @@ Roo.extend(Roo.bootstrap.Input, Roo.bootstrap.Component,  {
             return;
         }
         
-        var label = this.el.select('label', true).first();
-        var icon = this.el.select('i.fa-star', true).first();
-        
-        if(label && icon){
-            icon.remove();
+        if(this.indicator){
+            this.indicator.hide();
         }
         
         this.el.removeClass(this.invalidClass);
@@ -8729,16 +8837,8 @@ Roo.extend(Roo.bootstrap.Input, Roo.bootstrap.Component,  {
             return;
         }
         
-        var formGroup = this.el.findParent('.form-group', false, true);
-        
-        if(formGroup){
-            
-            var label = formGroup.select('label', true).first();
-            var icon = formGroup.select('i.fa-star', true).first();
-            
-            if(label && icon){
-                icon.remove();
-            }
+        if(this.indicator){
+            this.indicator.hide();
         }
         
         this.el.addClass(this.validClass);
@@ -8779,23 +8879,10 @@ Roo.extend(Roo.bootstrap.Input, Roo.bootstrap.Component,  {
             return;
         }
         
-        var formGroup = this.el.findParent('.form-group', false, true);
-        
-        if(formGroup){
-            var label = formGroup.select('label', true).first();
-            var icon = formGroup.select('i.fa-star', true).first();
-
-            if(!this.getValue().length && label && !icon){
-                this.el.findParent('.form-group', false, true).createChild({
-                    tag : 'i',
-                    cls : 'text-danger fa fa-lg fa-star',
-                    tooltip : 'This field is required',
-                    style : 'margin-right:5px;'
-                }, label, true);
-            }
+        if(this.indicator){
+            this.indicator.show();
         }
         
-        
         this.el.addClass(this.invalidClass);
         
         if(this.hasFeedback && this.inputType != 'hidden' && !this.allowBlank){
@@ -9470,14 +9557,41 @@ Roo.extend(Roo.bootstrap.TriggerField, Roo.bootstrap.Input,  {
         if (align ==='left' && this.fieldLabel.length && this.labelWidth) {
             
 //                Roo.log("left and has label");
+            cfg.cn = [
+                {
+                    tag : 'i',
+                    cls : 'roo-required-indicator left-indicator text-danger fa fa-lg fa-star',
+                    tooltip : 'This field is required'
+                },
+                {
+                    tag: 'label',
+                    'for' :  id,
+                    cls : 'control-label col-sm-' + this.labelWidth,
+                    html : this.fieldLabel
+
+                },
+                {
+                    cls : "col-sm-" + (12 - this.labelWidth), 
+                    cn: [
+                        combobox
+                    ]
+                }
+
+            ];
+            
+            if(this.indicatorpos == 'right'){
                 cfg.cn = [
-                    
                     {
                         tag: 'label',
                         'for' :  id,
                         cls : 'control-label col-sm-' + this.labelWidth,
                         html : this.fieldLabel
-                        
+
+                    },
+                    {
+                        tag : 'i',
+                        cls : 'roo-required-indicator right-indicator text-danger fa fa-lg fa-star',
+                        tooltip : 'This field is required'
                     },
                     {
                         cls : "col-sm-" + (12 - this.labelWidth), 
@@ -9485,23 +9599,50 @@ Roo.extend(Roo.bootstrap.TriggerField, Roo.bootstrap.Input,  {
                             combobox
                         ]
                     }
-                    
+
                 ];
+            }
+            
         } else if ( this.fieldLabel.length) {
 //                Roo.log(" label");
-                 cfg.cn = [
-                   
+            cfg.cn = [
+                {
+                   tag : 'i',
+                   cls : 'roo-required-indicator left-indicator text-danger fa fa-lg fa-star',
+                   tooltip : 'This field is required'
+               },
+               {
+                   tag: 'label',
+                   //cls : 'input-group-addon',
+                   html : this.fieldLabel
+
+               },
+
+               combobox
+
+            ];
+            
+            if(this.indicatorpos == 'right'){
+                
+                cfg.cn = [
                     {
-                        tag: 'label',
-                        //cls : 'input-group-addon',
-                        html : this.fieldLabel
-                        
+                       tag: 'label',
+                       //cls : 'input-group-addon',
+                       html : this.fieldLabel
+
+                    },
+                    {
+                       tag : 'i',
+                       cls : 'roo-required-indicator right-indicator text-danger fa fa-lg fa-star',
+                       tooltip : 'This field is required'
                     },
                     
                     combobox
-                    
+
                 ];
 
+            }
+
         } else {
             
 //                Roo.log(" no label && no align");
@@ -11933,7 +12074,10 @@ Roo.extend(Roo.bootstrap.ComboBox, Roo.bootstrap.TriggerField, {
      * in order for a value to be mapped.
      */
     valueField: undefined,
-    
+    /**
+     * @cfg {String} modalTitle The title of the dialog that pops up on mobile views.
+     */
+    modalTitle : '',
     
     /**
      * @cfg {String} hiddenName If specified, a hidden form field with this name is dynamically generated to store the
@@ -12081,6 +12225,13 @@ Roo.extend(Roo.bootstrap.ComboBox, Roo.bootstrap.TriggerField, {
      */
     mobileTouchView : true,
     
+    /**
+     * @cfg {Boolean} useNativeIOS (true|false) render it as classic select for ios, not support dynamic load data (default false)
+     */
+    useNativeIOS : false,
+    
+    ios_options : false,
+    
     //private
     addicon : false,
     editicon: false,
@@ -12104,6 +12255,15 @@ Roo.extend(Roo.bootstrap.ComboBox, Roo.bootstrap.TriggerField, {
     {
         var cfg = false;
         
+        /*
+         * Render classic select for iso
+         */
+        
+        if(Roo.isIOS && this.useNativeIOS){
+            cfg = this.getAutoCreateNativeIOS();
+            return cfg;
+        }
+        
         /*
          * Touch Devices
          */
@@ -12227,14 +12387,42 @@ Roo.extend(Roo.bootstrap.ComboBox, Roo.bootstrap.TriggerField, {
         if (align ==='left' && this.fieldLabel.length && this.labelWidth) {
             
 //                Roo.log("left and has label");
+            cfg.cn = [
+                {
+                    tag : 'i',
+                    cls : 'roo-required-indicator left-indicator text-danger fa fa-lg fa-star',
+                    tooltip : 'This field is required'
+                },
+                {
+                    tag: 'label',
+                    'for' :  id,
+                    cls : 'control-label col-sm-' + this.labelWidth,
+                    html : this.fieldLabel
+
+                },
+                {
+                    cls : "col-sm-" + (12 - this.labelWidth), 
+                    cn: [
+                        combobox
+                    ]
+                }
+
+            ];
+
+            if(this.indicatorpos == 'right'){
+                
                 cfg.cn = [
-                    
                     {
                         tag: 'label',
                         'for' :  id,
                         cls : 'control-label col-sm-' + this.labelWidth,
                         html : this.fieldLabel
-                        
+
+                    },
+                    {
+                        tag : 'i',
+                        cls : 'roo-required-indicator right-indicator text-danger fa fa-lg fa-star',
+                        tooltip : 'This field is required'
                     },
                     {
                         cls : "col-sm-" + (12 - this.labelWidth), 
@@ -12242,12 +12430,20 @@ Roo.extend(Roo.bootstrap.ComboBox, Roo.bootstrap.TriggerField, {
                             combobox
                         ]
                     }
-                    
+
                 ];
+            
+            }
+                
+                
         } else if ( this.fieldLabel.length) {
 //                Roo.log(" label");
                  cfg.cn = [
-                   
+                    {
+                        tag : 'i',
+                        cls : 'roo-required-indicator left-indicator text-danger fa fa-lg fa-star',
+                        tooltip : 'This field is required'
+                    },
                     {
                         tag: 'label',
                         //cls : 'input-group-addon',
@@ -12258,6 +12454,28 @@ Roo.extend(Roo.bootstrap.ComboBox, Roo.bootstrap.TriggerField, {
                     combobox
                     
                 ];
+                
+                if(this.indicatorpos == 'right'){
+                    
+                    cfg.cn = [
+                        {
+                            tag: 'label',
+                            //cls : 'input-group-addon',
+                            html : this.fieldLabel
+
+                        },
+                        
+                        {
+                            tag : 'i',
+                            cls : 'roo-required-indicator right-indicator text-danger fa fa-lg fa-star',
+                            tooltip : 'This field is required'
+                        },
+                        
+                        combobox
+
+                    ];
+                
+                }
 
         } else {
             
@@ -12282,8 +12500,7 @@ Roo.extend(Roo.bootstrap.ComboBox, Roo.bootstrap.TriggerField, {
     
     // private
     initEvents: function()
-    {
-        
+    {   
         if (this._initEventsCalled) { // as we call render... prevent looping...
             return;
         }
@@ -12315,6 +12532,10 @@ Roo.extend(Roo.bootstrap.ComboBox, Roo.bootstrap.TriggerField, {
             
         }
         
+        if(Roo.isIOS && this.useNativeIOS){
+            this.initIOSView();
+            return;
+        }
         
         /*
          * Touch Devices
@@ -12869,7 +13090,11 @@ Roo.extend(Roo.bootstrap.ComboBox, Roo.bootstrap.TriggerField, {
      * Returns the currently selected field value or empty string if no value is set.
      * @return {String} value The selected value
      */
-    getValue : function(){
+    getValue : function()
+    {
+        if(Roo.isIOS && this.useNativeIOS){
+            return this.ios_options[this.inputEl().dom.selectedIndex].data[this.valueField];
+        }
         
         if(this.multiple){
             return (this.hiddenField) ? this.hiddenField.dom.value : this.value;
@@ -12881,11 +13106,23 @@ Roo.extend(Roo.bootstrap.ComboBox, Roo.bootstrap.TriggerField, {
             return Roo.bootstrap.ComboBox.superclass.getValue.call(this);
         }
     },
+    
+    getRawValue : function()
+    {
+        if(Roo.isIOS && this.useNativeIOS){
+            return this.ios_options[this.inputEl().dom.selectedIndex].data[this.displayField];
+        }
+        
+        var v = this.inputEl().getValue();
+        
+        return v;
+    },
 
     /**
      * Clears any text/value currently set in the field
      */
     clearValue : function(){
+        
         if(this.hiddenField){
             this.hiddenField.dom.value = '';
         }
@@ -12900,6 +13137,8 @@ Roo.extend(Roo.bootstrap.ComboBox, Roo.bootstrap.TriggerField, {
             close.hide();
         }
         
+        this.validate();
+        
     },
 
     /**
@@ -12909,7 +13148,13 @@ Roo.extend(Roo.bootstrap.ComboBox, Roo.bootstrap.TriggerField, {
      * Otherwise the field will be blank (although the value will still be set).
      * @param {String} value The value to match
      */
-    setValue : function(v){
+    setValue : function(v)
+    {
+        if(Roo.isIOS && this.useNativeIOS){
+            this.setIOSValue(v);
+            return;
+        }
+        
         if(this.multiple){
             this.syncValue();
             return;
@@ -12936,6 +13181,8 @@ Roo.extend(Roo.bootstrap.ComboBox, Roo.bootstrap.TriggerField, {
         if(close){
             (v && (v.length || v * 1 > 0)) ? close.show() : close.hide();
         }
+        
+        this.validate();
     },
     /**
      * @property {Object} the last set data for the element
@@ -13000,11 +13247,13 @@ Roo.extend(Roo.bootstrap.ComboBox, Roo.bootstrap.TriggerField, {
         }
         
         this.setValue(this.originalValue);
-        this.clearInvalid();
+        //this.clearInvalid();
         this.lastData = false;
         if (this.view) {
             this.view.clearSelections();
         }
+        
+        this.validate();
     },
     // private
     findRecord : function(prop, value){
@@ -13350,6 +13599,8 @@ Roo.extend(Roo.bootstrap.ComboBox, Roo.bootstrap.TriggerField, {
             Roo.get(document).un('keydown', this.listKeyPress, this);
         }
         this.fireEvent('collapse', this);
+        
+        this.validate();
     },
 
     // private
@@ -13663,6 +13914,8 @@ Roo.extend(Roo.bootstrap.ComboBox, Roo.bootstrap.TriggerField, {
         }
         
         this.store.fireEvent("datachanged", this.store);
+        
+        this.validate();
     },
     
     clearItem : function()
@@ -13688,6 +13941,10 @@ Roo.extend(Roo.bootstrap.ComboBox, Roo.bootstrap.TriggerField, {
     
     inputEl: function ()
     {
+        if(Roo.isIOS && this.useNativeIOS){
+            return this.el.select('select.roo-ios-select', true).first();
+        }
+        
         if(Roo.isTouch && this.mobileTouchView){
             return this.el.select('input.form-control',true).first();
         }
@@ -13699,7 +13956,6 @@ Roo.extend(Roo.bootstrap.ComboBox, Roo.bootstrap.TriggerField, {
         return this.el.select('input.form-control',true).first();
     },
     
-    
     onTickableFooterButtonClick : function(e, btn, el)
     {
         e.preventDefault();
@@ -13871,46 +14127,46 @@ Roo.extend(Roo.bootstrap.ComboBox, Roo.bootstrap.TriggerField, {
         };
         
         var combobox = {
-            cls: 'roo-select2-container input-group',
+            cls: 'roo-select2-container input-group roo-touchview-combobox ',
             cn: [
                 box
             ]
         };
         
-//        if(!this.multiple && this.showToggleBtn){
-//            
-//            var caret = {
-//                        tag: 'span',
-//                        cls: 'caret'
-//            };
-//            
-//            if (this.caret != false) {
-//                caret = {
-//                     tag: 'i',
-//                     cls: 'fa fa-' + this.caret
-//                };
-//                
-//            }
-//            
-//            combobox.cn.push({
-//                tag :'span',
-//                cls : 'input-group-addon btn dropdown-toggle',
-//                cn : [
-//                    caret,
-//                    {
-//                        tag: 'span',
-//                        cls: 'combobox-clear',
-//                        cn  : [
-//                            {
-//                                tag : 'i',
-//                                cls: 'icon-remove'
-//                            }
-//                        ]
-//                    }
-//                ]
-//
-//            })
-//        }
+        if(!this.multiple && this.showToggleBtn){
+            
+            var caret = {
+                        tag: 'span',
+                        cls: 'caret'
+            };
+            
+            if (this.caret != false) {
+                caret = {
+                     tag: 'i',
+                     cls: 'fa fa-' + this.caret
+                };
+                
+            }
+            
+            combobox.cn.push({
+                tag :'span',
+                cls : 'input-group-addon btn dropdown-toggle',
+                cn : [
+                    caret,
+                    {
+                        tag: 'span',
+                        cls: 'combobox-clear',
+                        cn  : [
+                            {
+                                tag : 'i',
+                                cls: 'icon-remove'
+                            }
+                        ]
+                    }
+                ]
+
+            })
+        }
         
         if(this.multiple){
             combobox.cls += ' roo-select2-container-multi';
@@ -13926,6 +14182,11 @@ Roo.extend(Roo.bootstrap.ComboBox, Roo.bootstrap.TriggerField, {
             var cw = align === 'left' ? ('col-sm' + (12 - this.labelWidth)) : '';
             
             cfg.cn = [
+                {
+                   tag : 'i',
+                   cls : 'roo-required-indicator left-indicator text-danger fa fa-lg fa-star',
+                   tooltip : 'This field is required'
+                },
                 {
                     tag: 'label',
                     cls : 'control-label ' + lw,
@@ -13939,6 +14200,28 @@ Roo.extend(Roo.bootstrap.ComboBox, Roo.bootstrap.TriggerField, {
                     ]
                 }
             ];
+            
+            if(this.indicatorpos == 'right'){
+                cfg.cn = [
+                    {
+                        tag: 'label',
+                        cls : 'control-label ' + lw,
+                        html : this.fieldLabel
+
+                    },
+                    {
+                       tag : 'i',
+                       cls : 'roo-required-indicator right-indicator text-danger fa fa-lg fa-star',
+                       tooltip : 'This field is required'
+                    },
+                    {
+                        cls : cw, 
+                        cn: [
+                            combobox
+                        ]
+                    }
+                ];
+            }
         }
         
         var settings = this;
@@ -13962,7 +14245,10 @@ Roo.extend(Roo.bootstrap.ComboBox, Roo.bootstrap.TriggerField, {
         
         this.originalValue = this.getValue();
         
-        this.inputEl().on("touch", this.showTouchView, this);
+        this.triggerEl = this.el.select('span.dropdown-toggle',true).first();
+        
+        this.inputEl().on("click", this.showTouchView, this);
+        this.triggerEl.on("click", this.showTouchView, this);
         
         this.touchViewFooterEl.select('.roo-touch-view-cancel', true).first().on('click', this.hideTouchView, this);
         this.touchViewFooterEl.select('.roo-touch-view-ok', true).first().on('click', this.setTouchViewValue, this);
@@ -14037,8 +14323,8 @@ Roo.extend(Roo.bootstrap.ComboBox, Roo.bootstrap.TriggerField, {
         
         this.touchViewHeaderEl.hide();
 
-        if(this.fieldLabel.length){
-            this.touchViewHeaderEl.dom.innerHTML = this.fieldLabel;
+        if(this.modalTitle.length){
+            this.touchViewHeaderEl.dom.innerHTML = this.modalTitle;
             this.touchViewHeaderEl.show();
         }
 
@@ -14050,7 +14336,7 @@ Roo.extend(Roo.bootstrap.ComboBox, Roo.bootstrap.TriggerField, {
 
         var bodyHeight = Roo.lib.Dom.getViewHeight() - this.touchViewFooterEl.getHeight() + this.touchViewBodyEl.getPadding('tb');
 
-        if(this.fieldLabel.length){
+        if(this.modalTitle.length){
             bodyHeight = bodyHeight - this.touchViewHeaderEl.getHeight();
         }
         
@@ -14180,7 +14466,7 @@ Roo.extend(Roo.bootstrap.ComboBox, Roo.bootstrap.TriggerField, {
         
         var bodyHeight = Roo.lib.Dom.getViewHeight() - this.touchViewFooterEl.getHeight() + this.touchViewBodyEl.getPadding('tb');
 
-        if(this.fieldLabel.length){
+        if(this.modalTitle.length){
             bodyHeight = bodyHeight - this.touchViewHeaderEl.getHeight();
         }
 
@@ -14257,8 +14543,143 @@ Roo.extend(Roo.bootstrap.ComboBox, Roo.bootstrap.TriggerField, {
             this.addItem(r.data);
             this.tickItems.push(r.data);
         }
-    }
+    },
+    
+    getAutoCreateNativeIOS : function()
+    {
+        var cfg = {
+            cls: 'form-group' //input-group,
+        };
+        
+        var combobox =  {
+            tag: 'select',
+            cls : 'roo-ios-select'
+        };
+        
+        if (this.name) {
+            combobox.name = this.name;
+        }
+        
+        if (this.disabled) {
+            combobox.disabled = true;
+        }
+        
+        var settings = this;
+        
+        ['xs','sm','md','lg'].map(function(size){
+            if (settings[size]) {
+                cfg.cls += ' col-' + size + '-' + settings[size];
+            }
+        });
+        
+        cfg.cn = combobox;
+        
+        return cfg;
+        
+    },
     
+    initIOSView : function()
+    {
+        this.store.on('load', this.onIOSViewLoad, this);
+        
+        return;
+    },
+    
+    onIOSViewLoad : function()
+    {
+        if(this.store.getCount() < 1){
+            return;
+        }
+        
+        this.clearIOSView();
+        
+        if(this.allowBlank) {
+            
+            var default_text = '-- SELECT --';
+            
+            var opt = this.inputEl().createChild({
+                tag: 'option',
+                value : 0,
+                html : default_text
+            });
+            
+            var o = {};
+            o[this.valueField] = 0;
+            o[this.displayField] = default_text;
+            
+            this.ios_options.push({
+                data : o,
+                el : opt
+            });
+            
+        }
+        
+        this.store.data.each(function(d, rowIndex){
+            
+            var html = '';
+            
+            if(this.displayField && typeof(d.data[this.displayField]) != 'undefined'){
+                html = d.data[this.displayField];
+            }
+            
+            var value = '';
+            
+            if(this.valueField && typeof(d.data[this.valueField]) != 'undefined'){
+                value = d.data[this.valueField];
+            }
+            
+            var option = {
+                tag: 'option',
+                value : value,
+                html : html
+            };
+            
+            if(this.value == d.data[this.valueField]){
+                option['selected'] = true;
+            }
+            
+            var opt = this.inputEl().createChild(option);
+            
+            this.ios_options.push({
+                data : d.data,
+                el : opt
+            });
+            
+        }, this);
+        
+        this.inputEl().on('change', function(){
+           this.fireEvent('select', this);
+        }, this);
+        
+    },
+    
+    clearIOSView: function()
+    {
+        this.inputEl().dom.innerHTML = '';
+        
+        this.ios_options = [];
+    },
+    
+    setIOSValue: function(v)
+    {
+        this.value = v;
+        
+        if(!this.ios_options){
+            return;
+        }
+        
+        Roo.each(this.ios_options, function(opts){
+           
+           opts.el.dom.removeAttribute('selected');
+           
+           if(opts.data[this.valueField] != v){
+               return;
+           }
+           
+           opts.el.dom.setAttribute('selected', true);
+           
+        }, this);
+    }
 
     /** 
     * @cfg {Boolean} grow 
@@ -16449,6 +16870,7 @@ Roo.extend(Roo.bootstrap.ProgressBar, Roo.bootstrap.Component,  {
  * @cfg {Boolean} autoslide (true|false) auto slide .. default false
  * @cfg {Boolean} slideOnTouch (true|false) slide on touch .. default false
  * @cfg {Number} timer auto slide timer .. default 0 millisecond
+ * @cfg {Boolean} showarrow (true|false) show arrow default true
  * 
  * @constructor
  * Create a new TabGroup
@@ -16474,6 +16896,7 @@ Roo.extend(Roo.bootstrap.TabGroup, Roo.bootstrap.Column,  {
     autoslide : false,
     slideFn : false,
     slideOnTouch : false,
+    showarrow : true,
     
     getAutoCreate : function()
     {
@@ -16485,7 +16908,8 @@ Roo.extend(Roo.bootstrap.TabGroup, Roo.bootstrap.Column,  {
             cfg.cls += ' carousel slide';
             
             cfg.cn = [{
-               cls : 'carousel-inner'
+               cls : 'carousel-inner',
+               cn : []
             }];
         
             if(this.bullets  && !Roo.isTouch){
@@ -16498,19 +16922,43 @@ Roo.extend(Roo.bootstrap.TabGroup, Roo.bootstrap.Column,  {
                 if(this.bullets_cls){
                     bullets.cls = bullets.cls + ' ' + this.bullets_cls;
                 }
-                 /*
-                for (var i = 0; i < this.bullets; i++){
-                    bullets.cn.push({
-                        cls : 'bullet bullet-' + i
-                    });
-                }
-                */
+                
                 bullets.cn.push({
                     cls : 'clear'
                 });
                 
-                cfg.cn[0].cn = bullets;
+                cfg.cn[0].cn.push(bullets);
+            }
+            
+            if(this.showarrow){
+                cfg.cn[0].cn.push({
+                    tag : 'div',
+                    class : 'carousel-arrow',
+                    cn : [
+                        {
+                            tag : 'div',
+                            class : 'carousel-prev',
+                            cn : [
+                                {
+                                    tag : 'i',
+                                    class : 'fa fa-chevron-left'
+                                }
+                            ]
+                        },
+                        {
+                            tag : 'div',
+                            class : 'carousel-next',
+                            cn : [
+                                {
+                                    tag : 'i',
+                                    class : 'fa fa-chevron-right'
+                                }
+                            ]
+                        }
+                    ]
+                });
             }
+            
         }
         
         return cfg;
@@ -16518,7 +16966,7 @@ Roo.extend(Roo.bootstrap.TabGroup, Roo.bootstrap.Column,  {
     
     initEvents:  function()
     {
-        if(Roo.isTouch && this.slideOnTouch){
+        if(Roo.isTouch && this.slideOnTouch && !this.showarrow){
             this.el.on("touchstart", this.onTouchStart, this);
         }
         
@@ -16530,6 +16978,12 @@ Roo.extend(Roo.bootstrap.TabGroup, Roo.bootstrap.Column,  {
             }, this.timer);
         }
         
+        if(this.showarrow){
+            this.el.select('.carousel-prev', true).first().on('click', this.showPanelPrev, this);
+            this.el.select('.carousel-next', true).first().on('click', this.showPanelNext, this);
+        }
+        
+        
     },
     
     onTouchStart : function(e, el, o)
@@ -16801,6 +17255,7 @@ Roo.apply(Roo.bootstrap.TabGroup, {
  * @cfg {String} html panel content
  * @cfg {String} tabId  unique tab ID (will be autogenerated if not set. - used to match TabItem to Panel)
  * @cfg {String} navId The Roo.bootstrap.NavGroup which triggers show hide ()
+ * @cfg {String} href click to link..
  * 
  * 
  * @constructor
@@ -16839,12 +17294,13 @@ Roo.extend(Roo.bootstrap.TabPanel, Roo.bootstrap.Component,  {
     html: false,
     tabId: false,
     navId : false,
+    href : '',
     
     getAutoCreate : function(){
         var cfg = {
             tag: 'div',
             // item is needed for carousel - not sure if it has any effect otherwise
-            cls: 'tab-pane item',
+            cls: 'tab-pane item' + ((this.href.length) ? ' clickable ' : ''),
             html: this.html || ''
         };
         
@@ -16878,9 +17334,12 @@ Roo.extend(Roo.bootstrap.TabPanel, Roo.bootstrap.Component,  {
             }
         }
         
+        if(this.href.length){
+            this.el.on('click', this.onClick, this);
+        }
+        
     },
     
-    
     onRender : function(ct, position)
     {
        // Roo.log("Call onRender: " + this.xtype);
@@ -16906,6 +17365,13 @@ Roo.extend(Roo.bootstrap.TabPanel, Roo.bootstrap.Component,  {
         }
         
         this.fireEvent('changed', this, state);
+    },
+    
+    onClick: function(e)
+    {
+        e.preventDefault();
+        
+        window.location.href = this.href;
     }
     
     
@@ -17063,7 +17529,7 @@ Roo.extend(Roo.bootstrap.DateField, Roo.bootstrap.Input,  {
         this.isInput = true;
         this.component = this.el.select('.add-on', true).first() || false;
         this.component = (this.component && this.component.length === 0) ? false : this.component;
-        this.hasInput = this.component && this.inputEL().length;
+        this.hasInput = this.component && this.inputEl().length;
         
         if (typeof(this.minViewMode === 'string')) {
             switch (this.minViewMode) {
@@ -17842,6 +18308,54 @@ Roo.extend(Roo.bootstrap.DateField, Roo.bootstrap.Input,  {
     remove: function() 
     {
         this.picker().remove();
+    },
+    
+    validateValue : function(value)
+    {
+        if(value.length < 1)  {
+            if(this.allowBlank){
+                return true;
+            }
+            return false;
+        }
+        
+        if(value.length < this.minLength){
+            return false;
+        }
+        if(value.length > this.maxLength){
+            return false;
+        }
+        if(this.vtype){
+            var vt = Roo.form.VTypes;
+            if(!vt[this.vtype](value, this)){
+                return false;
+            }
+        }
+        if(typeof this.validator == "function"){
+            var msg = this.validator(value);
+            if(msg !== true){
+                return false;
+            }
+        }
+        
+        if(this.regex && !this.regex.test(value)){
+            return false;
+        }
+        
+        if(typeof(this.parseDate(value)) == 'undefined'){
+            return false;
+        }
+        
+        if (this.endDate !== Infinity && this.parseDate(value).getTime() > this.endDate.getTime()) {
+            return false;
+        }      
+        
+        if (this.startDate !== -Infinity && this.parseDate(value).getTime() < this.startDate.getTime()) {
+            return false;
+        } 
+        
+        
+        return true;
     }
    
 });
@@ -18963,12 +19477,22 @@ Roo.extend(Roo.bootstrap.CheckBox, Roo.bootstrap.Input,  {
             tag: 'input',
             id : id,
             type : this.inputType,
-            value : this.inputType == 'radio' ? this.inputValue : ((!this.checked) ? this.valueOff : this.inputValue),
+            value : this.inputValue,
             cls : 'roo-' + this.inputType, //'form-box',
             placeholder : this.placeholder || ''
             
         };
         
+        if(this.inputType != 'radio'){
+            var hidden =  {
+                tag: 'input',
+                type : 'hidden',
+                cls : 'roo-hidden-value',
+                value : this.checked ? this.valueOff : this.inputValue
+            };
+        }
+        
+            
         if (this.weight) { // Validity check?
             cfg.cls += " " + this.inputType + "-" + this.weight;
         }
@@ -18979,10 +19503,18 @@ Roo.extend(Roo.bootstrap.CheckBox, Roo.bootstrap.Input,  {
         
         if(this.checked){
             input.checked = this.checked;
+            
         }
         
+        
         if (this.name) {
+            
             input.name = this.name;
+            
+            if(this.inputType != 'radio'){
+                hidden.name = this.name;
+                input.name = '_hidden_' + this.name;
+            }
         }
         
         if (this.size) {
@@ -19016,6 +19548,10 @@ Roo.extend(Roo.bootstrap.CheckBox, Roo.bootstrap.Input,  {
             
             inputblock.cn.push(input);
             
+            if(this.inputType != 'radio'){
+                inputblock.cn.push(hidden);
+            }
+            
             if (this.after) {
                 inputblock.cn.push({
                     tag :'span',
@@ -19085,8 +19621,10 @@ Roo.extend(Roo.bootstrap.CheckBox, Roo.bootstrap.Input,  {
             cfg.cn.push(boxLabelCfg);
         }
         
+        if(this.inputType != 'radio'){
+            cfg.cn.push(hidden);
+        }
         
-       
         return cfg;
         
     },
@@ -19098,6 +19636,10 @@ Roo.extend(Roo.bootstrap.CheckBox, Roo.bootstrap.Input,  {
     {
         return this.el.select('input.roo-' + this.inputType,true).first();
     },
+    hiddenEl: function ()
+    {
+        return this.el.select('input.roo-hidden-value',true).first();
+    },
     
     labelEl: function()
     {
@@ -19164,7 +19706,8 @@ Roo.extend(Roo.bootstrap.CheckBox, Roo.bootstrap.Input,  {
         
         this.inputEl().dom.checked = state;
         
-        this.inputEl().dom.value = state ? this.inputValue : this.valueOff;
+        
+        this.hiddenEl().dom.value = state ? this.inputValue : this.valueOff;
         
         if(suppressEvent !== true){
             this.fireEvent('check', this, state);
@@ -19179,7 +19722,7 @@ Roo.extend(Roo.bootstrap.CheckBox, Roo.bootstrap.Input,  {
             return this.getGroupValue();
         }
         
-        return this.inputEl().getValue();
+        return this.hiddenEl().dom.value;
         
     },
     
@@ -19242,6 +19785,10 @@ Roo.extend(Roo.bootstrap.CheckBox, Roo.bootstrap.Input,  {
     
     validateRadio : function()
     {
+        if(this.allowBlank){
+            return true;
+        }
+        
         var valid = false;
         
         Roo.each(this.el.up('form').select('input[name='+this.name+']', true).elements, function(e){
@@ -19382,8 +19929,50 @@ Roo.extend(Roo.bootstrap.CheckBox, Roo.bootstrap.Input,  {
             group[i].el.findParent('.form-group', false, true).addClass(this.invalidClass);
         }
         
-    }
+    },
     
+    disable : function()
+    {
+        if(this.inputType != 'radio'){
+            Roo.bootstrap.CheckBox.superclass.disable.call(this);
+            return;
+        }
+        
+        var _this = this;
+        
+        if(this.rendered){
+            Roo.each(this.el.up('form').select('input[name='+this.name+']', true).elements, function(e){
+                _this.getActionEl().addClass(this.disabledClass);
+                e.dom.disabled = true;
+            });
+        }
+        
+        this.disabled = true;
+        this.fireEvent("disable", this);
+        return this;
+    },
+
+    enable : function()
+    {
+        if(this.inputType != 'radio'){
+            Roo.bootstrap.CheckBox.superclass.enable.call(this);
+            return;
+        }
+        
+        var _this = this;
+        
+        if(this.rendered){
+            Roo.each(this.el.up('form').select('input[name='+this.name+']', true).elements, function(e){
+                _this.getActionEl().removeClass(this.disabledClass);
+                e.dom.disabled = false;
+            });
+        }
+        
+        this.disabled = false;
+        this.fireEvent("enable", this);
+        return this;
+    }
+
 });
 
 Roo.apply(Roo.bootstrap.CheckBox, {
@@ -19444,8 +20033,8 @@ Roo.apply(Roo.bootstrap.CheckBox, {
   <input type="radio" name="inlineRadioOptions" id="inlineRadio1" value="option1"> 1
 </label>
 <span>
- * 
- * 
+ *
+ *
  */
 
 /**
@@ -19460,32 +20049,32 @@ Roo.apply(Roo.bootstrap.CheckBox, {
 
 Roo.bootstrap.Radio = function(config){
     Roo.bootstrap.Radio.superclass.constructor.call(this, config);
-   
+
 };
 
 Roo.extend(Roo.bootstrap.Radio, Roo.bootstrap.CheckBox,  {
-    
+
     inputType: 'radio',
     inputValue: '',
     valueOff: '',
-    
+
     getAutoCreate : function()
     {
         var align = (!this.labelAlign) ? this.parentLabelAlign() : this.labelAlign;
         align = align || 'left'; // default...
-        
-        
-        
+
+
+
         var id = Roo.id();
-        
+
         var cfg = {
                 tag : this.inline ? 'span' : 'div',
-                cls : '',
+                cls : 'form-group',
                 cn : []
         };
-        
+
         var inline = this.inline ? ' radio-inline' : '';
-        
+
         var lbl = {
                 tag: 'label' ,
                 // does not need for, as we wrap the input with it..
@@ -19494,17 +20083,14 @@ Roo.extend(Roo.bootstrap.Radio, Roo.bootstrap.CheckBox,  {
                 cn : []
         };
         var labelWidth = this.labelWidth ? this.labelWidth *1 : 100;
-        
+
         var fieldLabel = {
             tag: 'label' ,
             //cls : 'control-label' + inline,
             html : this.fieldLabel,
             style : 'width:' +  labelWidth  + 'px;line-height:1;vertical-align:bottom;cursor:default;' // should be css really.
         };
-        
-        
-        
+
         var input =  {
             tag: 'input',
             id : id,
@@ -19513,7 +20099,7 @@ Roo.extend(Roo.bootstrap.Radio, Roo.bootstrap.CheckBox,  {
             value : this.inputValue,
             cls : 'roo-radio',
             placeholder : this.placeholder || '' // ?? needed????
-            
+
         };
         if (this.weight) { // Validity check?
             input.cls += " radio-" + this.weight;
@@ -19521,36 +20107,36 @@ Roo.extend(Roo.bootstrap.Radio, Roo.bootstrap.CheckBox,  {
         if (this.disabled) {
             input.disabled=true;
         }
-        
+
         if(this.checked){
             input.checked = this.checked;
         }
-        
+
         if (this.name) {
             input.name = this.name;
         }
-        
+
         if (this.size) {
             input.cls += ' input-' + this.size;
         }
-        
+
         //?? can span's inline have a width??
-        
+
         var settings=this;
         ['xs','sm','md','lg'].map(function(size){
             if (settings[size]) {
                 cfg.cls += ' col-' + size + '-' + settings[size];
             }
         });
-        
+
         var inputblock = input;
-        
+
         if (this.before || this.after) {
-            
+
             inputblock = {
                 cls : 'input-group',
                 tag : 'span',
-                cn :  [] 
+                cn :  []
             };
             if (this.before) {
                 inputblock.cn.push({
@@ -19567,19 +20153,19 @@ Roo.extend(Roo.bootstrap.Radio, Roo.bootstrap.CheckBox,  {
                     html : this.after
                 });
             }
-            
+
         };
-        
-        
+
+
         if (this.fieldLabel && this.fieldLabel.length) {
             cfg.cn.push(fieldLabel);
         }
-       
+
         // normal bootstrap puts the input inside the label.
         // however with our styled version - it has to go after the input.
-       
+
         //lbl.cn.push(inputblock);
-        
+
         var lblwrap =  {
             tag: 'span',
             cls: 'radio' + inline,
@@ -19588,43 +20174,43 @@ Roo.extend(Roo.bootstrap.Radio, Roo.bootstrap.CheckBox,  {
                 lbl
             ]
         };
-        
+
         cfg.cn.push( lblwrap);
-        
+
         if(this.boxLabel){
             lbl.cn.push({
                 tag: 'span',
                 html: this.boxLabel
             })
         }
-         
-        
+
+
         return cfg;
-        
+
     },
-    
+
     initEvents : function()
     {
 //        Roo.bootstrap.CheckBox.superclass.initEvents.call(this);
-        
+
         this.inputEl().on('click', this.onClick,  this);
         if (this.boxLabel) {
             //Roo.log('find label');
             this.el.select('span.radio label span',true).first().on('click', this.onClick,  this);
         }
-        
+
     },
-    
+
     inputEl: function ()
     {
         return this.el.select('input.roo-radio',true).first();
     },
     onClick : function()
-    {   
+    {
         Roo.log("click");
         this.setChecked(true);
     },
-    
+
     setChecked : function(state,suppressEvent)
     {
         if(state){
@@ -19635,15 +20221,15 @@ Roo.extend(Roo.bootstrap.Radio, Roo.bootstrap.CheckBox,  {
         Roo.log(this.inputEl().dom);
         this.checked = state;
         this.inputEl().dom.checked = state;
-        
+
         if(suppressEvent !== true){
             this.fireEvent('check', this, state);
         }
-        
+
         //this.inputEl().dom.value = state ? this.inputValue : this.valueOff;
-        
+
     },
-    
+
     getGroupValue : function()
     {
         var value = '';
@@ -19652,10 +20238,10 @@ Roo.extend(Roo.bootstrap.Radio, Roo.bootstrap.CheckBox,  {
                 value = v.dom.value;
             }
         });
-        
+
         return value;
     },
-    
+
     /**
      * Returns the normalized data value (undefined or emptyText will be returned as '').  To return the raw value see {@link #getRawValue}.
      * @return {Mixed} value The field value
@@ -19663,10 +20249,8 @@ Roo.extend(Roo.bootstrap.Radio, Roo.bootstrap.CheckBox,  {
     getValue : function(){
         return this.getGroupValue();
     }
-    
-});
 
+});
 //<script type="text/javascript">
 
 /*
@@ -22142,7 +22726,7 @@ Roo.bootstrap.Table.RowSelectionModel = function(config){
     });
     Roo.bootstrap.Table.RowSelectionModel.superclass.constructor.call(this);
     this.locked = false;
-};
+ };
 
 Roo.extend(Roo.bootstrap.Table.RowSelectionModel, Roo.bootstrap.Table.AbstractSelectionModel,  {
     /**
@@ -22152,14 +22736,17 @@ Roo.extend(Roo.bootstrap.Table.RowSelectionModel, Roo.bootstrap.Table.AbstractSe
     singleSelect : false,
 
     // private
-    initEvents : function(){
-
-        if(!this.grid.enableDragDrop && !this.grid.enableDrag){
-            this.grid.on("mousedown", this.handleMouseDown, this);
-        }else{ // allow click to work like normal
-            this.grid.on("rowclick", this.handleDragableRowClick, this);
-        }
+    initEvents : function()
+    {
 
+        //if(!this.grid.enableDragDrop && !this.grid.enableDrag){
+        //    this.growclickrid.on("mousedown", this.handleMouseDown, this);
+        //}else{ // allow click to work like normal
+         //   this.grid.on("rowclick", this.handleDragableRowClick, this);
+        //}
+        //this.grid.on("rowdblclick", this.handleMouseDBClick, this);
+        this.grid.on("rowclick", this.handleMouseDown, this);
+        
         this.rowNav = new Roo.KeyNav(this.grid.getGridEl(), {
             "up" : function(e){
                 if(!e.shiftKey){
@@ -22193,16 +22780,21 @@ Roo.extend(Roo.bootstrap.Table.RowSelectionModel, Roo.bootstrap.Table.AbstractSe
             },
             scope: this
         });
-
+        this.grid.store.on('load', function(){
+            this.selections.clear();
+        },this);
+        /*
         var view = this.grid.view;
         view.on("refresh", this.onRefresh, this);
         view.on("rowupdated", this.onRowUpdated, this);
         view.on("rowremoved", this.onRemove, this);
+        */
     },
 
     // private
-    onRefresh : function(){
-        var ds = this.grid.dataSource, i, v = this.grid.view;
+    onRefresh : function()
+    {
+        var ds = this.grid.store, i, v = this.grid.view;
         var s = this.selections;
         s.each(function(r){
             if((i = ds.indexOfId(r.id)) != -1){
@@ -22230,11 +22822,12 @@ Roo.extend(Roo.bootstrap.Table.RowSelectionModel, Roo.bootstrap.Table.AbstractSe
      * @param {Array} records The records to select
      * @param {Boolean} keepExisting (optional) True to keep existing selections
      */
-    selectRecords : function(records, keepExisting){
+    selectRecords : function(records, keepExisting)
+    {
         if(!keepExisting){
             this.clearSelections();
         }
-        var ds = this.grid.dataSource;
+           var ds = this.grid.store;
         for(var i = 0, len = records.length; i < len; i++){
             this.selectRow(ds.indexOf(records[i]), true);
         }
@@ -22260,15 +22853,17 @@ Roo.extend(Roo.bootstrap.Table.RowSelectionModel, Roo.bootstrap.Table.AbstractSe
      * @param {Boolean} keepExisting (optional) True to keep existing selections
      */
     selectLastRow : function(keepExisting){
-        this.selectRow(this.grid.dataSource.getCount() - 1, keepExisting);
+        //this.selectRow(this.grid.dataSource.getCount() - 1, keepExisting);
+        this.selectRow(this.grid.store.getCount() - 1, keepExisting);
     },
 
     /**
      * Selects the row immediately following the last selected row.
      * @param {Boolean} keepExisting (optional) True to keep existing selections
      */
-    selectNext : function(keepExisting){
-        if(this.last !== false && (this.last+1) < this.grid.dataSource.getCount()){
+    selectNext : function(keepExisting)
+    {
+           if(this.last !== false && (this.last+1) < this.grid.store.getCount()){
             this.selectRow(this.last+1, keepExisting);
             this.grid.getView().focusRow(this.last);
         }
@@ -22305,12 +22900,13 @@ Roo.extend(Roo.bootstrap.Table.RowSelectionModel, Roo.bootstrap.Table.AbstractSe
     /**
      * Clears all selections.
      */
-    clearSelections : function(fast){
+    clearSelections : function(fast)
+    {
         if(this.locked) {
             return;
         }
         if(fast !== true){
-            var ds = this.grid.dataSource;
+               var ds = this.grid.store;
             var s = this.selections;
             s.each(function(r){
                 this.deselectRow(ds.indexOfId(r.id));
@@ -22331,7 +22927,7 @@ Roo.extend(Roo.bootstrap.Table.RowSelectionModel, Roo.bootstrap.Table.AbstractSe
             return;
         }
         this.selections.clear();
-        for(var i = 0, len = this.grid.dataSource.getCount(); i < len; i++){
+        for(var i = 0, len = this.grid.store.getCount(); i < len; i++){
             this.selectRow(i, true);
         }
     },
@@ -22350,7 +22946,7 @@ Roo.extend(Roo.bootstrap.Table.RowSelectionModel, Roo.bootstrap.Table.AbstractSe
      * @return {Boolean}
      */
     isSelected : function(index){
-        var r = typeof index == "number" ? this.grid.dataSource.getAt(index) : index;
+           var r = typeof index == "number" ? this.grid.store.getAt(index) : index;
         return (r && this.selections.key(r.id) ? true : false);
     },
 
@@ -22363,27 +22959,44 @@ Roo.extend(Roo.bootstrap.Table.RowSelectionModel, Roo.bootstrap.Table.AbstractSe
         return (this.selections.key(id) ? true : false);
     },
 
+
     // private
-    handleMouseDown : function(e, t){
-        var view = this.grid.getView(), rowIndex;
-        if(this.isLocked() || (rowIndex = view.findRowIndex(t)) === false){
+    handleMouseDBClick : function(e, t){
+       
+    },
+    // private
+    handleMouseDown : function(e, t)
+    {
+           var rowIndex = this.grid.headerShow  ? t.dom.rowIndex - 1 : t.dom.rowIndex ; // first row is header???
+        if(this.isLocked() || rowIndex < 0 ){
             return;
         };
         if(e.shiftKey && this.last !== false){
             var last = this.last;
             this.selectRange(last, rowIndex, e.ctrlKey);
             this.last = last; // reset the last
-            view.focusRow(rowIndex);
+            t.focus();
+    
         }else{
             var isSelected = this.isSelected(rowIndex);
-            if(e.button !== 0 && isSelected){
-                view.focusRow(rowIndex);
-            }else if(e.ctrlKey && isSelected){
+            //Roo.log("select row:" + rowIndex);
+            if(isSelected){
                 this.deselectRow(rowIndex);
-            }else if(!isSelected){
-                this.selectRow(rowIndex, e.button === 0 && (e.ctrlKey || e.shiftKey));
-                view.focusRow(rowIndex);
+            } else {
+                       this.selectRow(rowIndex, true);
             }
+    
+            /*
+                if(e.button !== 0 && isSelected){
+                alert('rowIndex 2: ' + rowIndex);
+                    view.focusRow(rowIndex);
+                }else if(e.ctrlKey && isSelected){
+                    this.deselectRow(rowIndex);
+                }else if(!isSelected){
+                    this.selectRow(rowIndex, e.button === 0 && (e.ctrlKey || e.shiftKey));
+                    view.focusRow(rowIndex);
+                }
+            */
         }
         this.fireEvent("afterselectionchange", this);
     },
@@ -22454,19 +23067,26 @@ Roo.extend(Roo.bootstrap.Table.RowSelectionModel, Roo.bootstrap.Table.AbstractSe
      * @param {Number} row The index of the row to select
      * @param {Boolean} keepExisting (optional) True to keep existing selections
      */
-    selectRow : function(index, keepExisting, preventViewNotify){
-        if(this.locked || (index < 0 || index >= this.grid.dataSource.getCount())) {
+    selectRow : function(index, keepExisting, preventViewNotify)
+    {
+           if(this.locked || (index < 0 || index > this.grid.store.getCount())) {
             return;
         }
         if(this.fireEvent("beforerowselect", this, index, keepExisting) !== false){
             if(!keepExisting || this.singleSelect){
                 this.clearSelections();
             }
-            var r = this.grid.dataSource.getAt(index);
+           
+            var r = this.grid.store.getAt(index);
+            //console.log('selectRow - record id :' + r.id);
+            
             this.selections.add(r);
             this.last = this.lastActive = index;
             if(!preventViewNotify){
-                this.grid.getView().onRowSelect(index);
+                var proxy = new Roo.Element(
+                                this.grid.getRowDom(index)
+                );
+                proxy.addClass('bg-info info');
             }
             this.fireEvent("rowselect", this, index, r);
             this.fireEvent("selectionchange", this);
@@ -22477,7 +23097,8 @@ Roo.extend(Roo.bootstrap.Table.RowSelectionModel, Roo.bootstrap.Table.AbstractSe
      * Deselects a row.
      * @param {Number} row The index of the row to deselect
      */
-    deselectRow : function(index, preventViewNotify){
+    deselectRow : function(index, preventViewNotify)
+    {
         if(this.locked) {
             return;
         }
@@ -22487,10 +23108,20 @@ Roo.extend(Roo.bootstrap.Table.RowSelectionModel, Roo.bootstrap.Table.AbstractSe
         if(this.lastActive == index){
             this.lastActive = false;
         }
-        var r = this.grid.dataSource.getAt(index);
+       
+        var r = this.grid.store.getAt(index);
+        if (!r) {
+            return;
+        }
+        
         this.selections.remove(r);
+        //.console.log('deselectRow - record id :' + r.id);
         if(!preventViewNotify){
-            this.grid.getView().onRowDeselect(index);
+       
+           var proxy = new Roo.Element(
+                this.grid.getRowDom(index)
+            );
+            proxy.removeClass('bg-info info');
         }
         this.fireEvent("rowdeselect", this, index);
         this.fireEvent("selectionchange", this);
@@ -22534,7 +23165,8 @@ Roo.extend(Roo.bootstrap.Table.RowSelectionModel, Roo.bootstrap.Table.AbstractSe
             g.startEditing(newCell[0], newCell[1]);
         }
     }
-});/*
+});
+/*
  * Based on:
  * Ext JS Library 1.1.1
  * Copyright(c) 2006-2007, Ext JS, LLC.
@@ -24110,6 +24742,11 @@ Roo.apply(Roo.bootstrap.Tooltip, {
             this.currentTip.el.setVisibilityMode(Roo.Element.DISPLAY).hide(); // force hiding...
         }    
         //Roo.log(ev);
+        
+        if(!el || el.dom == document){
+            return;
+        }
+        
         var bindEl = el;
         
         // you can not look for children, as if el is the body.. then everythign is the child..
@@ -24298,6 +24935,13 @@ Roo.extend(Roo.bootstrap.Tooltip, Roo.bootstrap.Component,  {
             if(xy[0] + this.el.getWidth() > Roo.lib.Dom.getViewWidth()){
                 placement = 'left';
             }
+            
+            var scroll = Roo.select('body', true).first().getScroll();
+            
+            if(xy[1] > Roo.lib.Dom.getViewHeight() + scroll.top - this.el.getHeight()){
+                placement = 'top';
+            }
+            
         }
         
         align = Roo.bootstrap.Tooltip.alignment[placement];
@@ -31423,6 +32067,14 @@ Roo.extend(Roo.bootstrap.layout.Border, Roo.bootstrap.layout.Manager, {
         if(this.updating) {
             return;
         }
+        
+        // render all the rebions if they have not been done alreayd?
+        Roo.each(Roo.bootstrap.layout.Border.regions, function(region) {
+            if(this.regions[region] && !this.regions[region].bodyEl){
+                this.regions[region].onRender(this.el)
+            }
+        },this);
+        
         var size = this.getViewSize();
         var w = size.width;
         var h = size.height;
@@ -32203,12 +32855,13 @@ Roo.bootstrap.layout.Region = function(config)
      
     this.visible = true;
     this.collapsed = false;
+    this.unrendered_panels = [];
 };
 
 Roo.extend(Roo.bootstrap.layout.Region, Roo.bootstrap.layout.Basic, {
 
     position: '', // set by wrapper (eg. north/south etc..)
-
+    unrendered_panels : null,  // unrendered panels.
     createBody : function(){
         /** This region's body element 
         * @type Roo.Element */
@@ -32278,6 +32931,15 @@ Roo.extend(Roo.bootstrap.layout.Region, Roo.bootstrap.layout.Basic, {
         if(this.config.hidden){
             this.hide();
         }
+        
+        if (this.unrendered_panels && this.unrendered_panels.length) {
+            for (var i =0;i< this.unrendered_panels.length; i++) {
+                this.add(this.unrendered_panels[i]);
+            }
+            this.unrendered_panels = null;
+            
+        }
+        
     },
     
     applyConfig : function(c)
@@ -32390,6 +33052,10 @@ Roo.extend(Roo.bootstrap.layout.Region, Roo.bootstrap.layout.Basic, {
 */
     updateBox : function(box)
     {
+        if (!this.bodyEl) {
+            return; // not rendered yet..
+        }
+        
         this.box = box;
         if(!this.collapsed){
             this.el.dom.style.left = box.x + "px";
@@ -32414,7 +33080,7 @@ Roo.extend(Roo.bootstrap.layout.Region, Roo.bootstrap.layout.Basic, {
                 w += this.config.adjustments[0];
             }
         }
-        if(h !== null){
+        if(h !== null && h > 0){
             this.el.setHeight(h);
             h = this.titleEl && this.titleEl.isDisplayed() ? h - (this.titleEl.getHeight()||0) : h;
             h -= this.el.getBorderWidth("tb");
@@ -32566,7 +33232,8 @@ Roo.extend(Roo.bootstrap.layout.Region, Roo.bootstrap.layout.Basic, {
 
     initTabs : function()
     {
-        this.bodyEl.setStyle("overflow", "hidden");
+        //this.bodyEl.setStyle("overflow", "hidden"); -- this is set in render?
+        
         var ts = new Roo.bootstrap.panel.Tabs({
                 el: this.bodyEl.dom,
                 tabPosition: this.bottomTabs ? 'bottom' : 'top',
@@ -32583,7 +33250,7 @@ Roo.extend(Roo.bootstrap.layout.Region, Roo.bootstrap.layout.Basic, {
         ts.maxTabWidth = this.config.maxTabWidth || 250;
         ts.preferredTabWidth = this.config.preferredTabWidth || 150;
         ts.monitorResize = false;
-        ts.bodyEl.setStyle("overflow", this.config.autoScroll ? "auto" : "hidden");
+        //ts.bodyEl.setStyle("overflow", this.config.autoScroll ? "auto" : "hidden"); // this is set in render?
         ts.bodyEl.addClass('roo-layout-tabs-body');
         this.panels.each(this.initPanelAsTab, this);
     },
@@ -32591,7 +33258,8 @@ Roo.extend(Roo.bootstrap.layout.Region, Roo.bootstrap.layout.Basic, {
     initPanelAsTab : function(panel){
         var ti = this.tabs.addTab(
                     panel.getEl().id,
-                    panel.getTitle(), null,
+                    panel.getTitle(),
+                    null,
                     this.config.closeOnTab && panel.isClosable()
             );
         if(panel.tabTip !== undefined){
@@ -32698,20 +33366,33 @@ Roo.extend(Roo.bootstrap.layout.Region, Roo.bootstrap.layout.Basic, {
      * @param {ContentPanel...} panel The ContentPanel(s) to add (you can pass more than one)
      * @return {Roo.ContentPanel} The panel added (if only one was added; null otherwise)
      */
-    add : function(panel){
+    add : function(panel)
+    {
         if(arguments.length > 1){
             for(var i = 0, len = arguments.length; i < len; i++) {
                 this.add(arguments[i]);
             }
             return null;
         }
+        
+        // if we have not been rendered yet, then we can not really do much of this..
+        if (!this.bodyEl) {
+            this.unrendered_panels.push(panel);
+            return panel;
+        }
+        
+        
+        
+        
         if(this.hasPanel(panel)){
             this.showPanel(panel);
             return panel;
         }
         panel.setRegion(this);
         this.panels.add(panel);
-        if(this.panels.getCount() == 1 && !this.config.alwaysShowTabs){
+       /* if(this.panels.getCount() == 1 && !this.config.alwaysShowTabs){
+            // sinle panel - no tab...?? would it not be better to render it with the tabs,
+            // and hide them... ???
             this.bodyEl.dom.appendChild(panel.getEl().dom);
             if(panel.background !== true){
                 this.setActivePanel(panel);
@@ -32719,6 +33400,7 @@ Roo.extend(Roo.bootstrap.layout.Region, Roo.bootstrap.layout.Basic, {
             this.fireEvent("paneladded", this, panel);
             return panel;
         }
+        */
         if(!this.tabs){
             this.initTabs();
         }else{
@@ -33630,10 +34312,18 @@ Roo.extend(Roo.bootstrap.panel.Content, Roo.bootstrap.Component, {
     tabTip:'',
     setRegion : function(region){
         this.region = region;
-        if(region){
+        this.setActiveClass(region && !this.background);
+    },
+    
+    
+    setActiveClass: function(state)
+    {
+        if(state){
            this.el.replaceClass("roo-layout-inactive-content", "roo-layout-active-content");
+           this.el.setStyle('position','relative');
         }else{
            this.el.replaceClass("roo-layout-active-content", "roo-layout-inactive-content");
+           this.el.setStyle('position', 'absolute');
         } 
     },
     
@@ -33645,8 +34335,10 @@ Roo.extend(Roo.bootstrap.panel.Content, Roo.bootstrap.Component, {
         return this.toolbar;
     },
     
-    setActiveState : function(active){
+    setActiveState : function(active)
+    {
         this.active = active;
+        this.setActiveClass(active);
         if(!active){
             this.fireEvent("deactivate", this);
         }else{
@@ -34113,7 +34805,11 @@ Roo.extend(Roo.bootstrap.panel.Nest, Roo.bootstrap.panel.Content, {
         if(!this.ignoreResize(width, height)){
             var size = this.adjustForComponents(width, height);
             var el = this.layout.getEl();
-            el.setSize(size.width, size.height);
+            if (size.height < 1) {
+                el.setWidth(size.width);   
+            } else {
+                el.setSize(size.width, size.height);
+            }
             var touch = el.dom.offsetWidth;
             this.layout.layout();
             // ie requires a double layout on the first pass
@@ -34128,6 +34824,8 @@ Roo.extend(Roo.bootstrap.panel.Nest, Roo.bootstrap.panel.Content, {
     
     setActiveState : function(active){
         this.active = active;
+        this.setActiveClass(active);
+        
         if(!active){
             this.fireEvent("deactivate", this);
             return;
@@ -34674,8 +35372,12 @@ Roo.extend(Roo.bootstrap.panel.Tabs, Roo.util.Observable, {
     createStripElements :  function(stripEl, text, closable)
     {
         var td = document.createElement("li"); // was td..
-        stripEl.insertBefore(td, stripEl.childNodes[stripEl.childNodes.length-1]);
-        //stripEl.appendChild(td);
+        
+        
+        //stripEl.insertBefore(td, stripEl.childNodes[stripEl.childNodes.length-1]);
+        
+        
+        stripEl.appendChild(td);
         /*if(closable){
             td.className = "x-tabs-closable";
             if(!this.closeTpl){