comment out row/cell selection requirement for cellclick - no idea why that was done...
[roojs1] / roojs-bootstrap.js
index cf57021..b56cdcf 100644 (file)
@@ -154,17 +154,17 @@ if(g){C[g].remove(F);F.un("beforecheckchange",onBeforeCheck);}}};}();
 // Roo/bootstrap/Menu.js
 Roo.bootstrap.Menu=function(A){if(A.type=='treeview'){this.container_method='getChildContainer';}Roo.bootstrap.Menu.superclass.constructor.call(this,A);if(this.registerMenu&&this.type!='treeview'){Roo.bootstrap.MenuMgr.register(this);}this.addEvents({beforeshow:true,beforehide:true,show:true,hide:true,click:true,mouseover:true,mouseout:true,itemclick:true}
 );this.menuitems=new Roo.util.MixedCollection(false,function(o){return o.el.id;});};Roo.extend(Roo.bootstrap.Menu,Roo.bootstrap.Component,{triggerEl:false,type:false,registerMenu:true,menuItems:false,hidden:true,parentMenu:false,stopEvent:true,isLink:false,container_method:'getDocumentBody',hideTrigger:false,align:'tl-bl?',getChildContainer:function(){return this.el;
-},getAutoCreate:function(){var A={tag:'ul',cls:'dropdown-menu shadow',style:'z-index:1000'};if(this.type==='submenu'){A.cls='submenu active';}if(this.type==='treeview'){A.cls='treeview-menu';}return A;},initEvents:function(){this.triggerEl.on('click',this.onTriggerClick,this);
+},getAutoCreate:function(){var A={tag:'ul',cls:'dropdown-menu shadow',style:'z-index:1000'};if(this.type==='submenu'){A.cls='submenu active';}if(this.type==='treeview'){A.cls='treeview-menu';}return A;},initEvents:function(){if(this.triggerEl){this.triggerEl.on('click',this.onTriggerClick,this);
 this.triggerEl.on(Roo.isTouch?'touchstart':'mouseup',this.onTriggerPress,this);if(!this.hideTrigger){if(this.triggerEl.hasClass('nav-item')&&this.triggerEl.select('.nav-link',true).length){this.triggerEl.select('.nav-link',true).first().addClass('dropdown-toggle');
-}else{this.triggerEl.addClass('dropdown-toggle');}}if(Roo.isTouch){this.el.on('touchstart',this.onTouch,this);}this.el.on('click',this.onClick,this);this.el.on("mouseover",this.onMouseOver,this);this.el.on("mouseout",this.onMouseOut,this);},findTargetItem:function(e){var t=e.getTarget(".dropdown-menu-item",this.el,true);
+}else{this.triggerEl.addClass('dropdown-toggle');}}}if(Roo.isTouch){this.el.on('touchstart',this.onTouch,this);}this.el.on('click',this.onClick,this);this.el.on("mouseover",this.onMouseOver,this);this.el.on("mouseout",this.onMouseOut,this);},findTargetItem:function(e){var t=e.getTarget(".dropdown-menu-item",this.el,true);
 if(!t){return false;}if(t&&t.id){return this.menuitems.get(t.id);}return false;},onTouch:function(e){Roo.log("menu.onTouch");this.onClick(e);},onClick:function(e){Roo.log("menu.onClick");var t=this.findTargetItem(e);if(!t||t.isContainer){return;}Roo.log(e);
 Roo.log('pass click event');t.onClick(e);this.fireEvent("click",this,t,e);var A=this;if(!t.href.length||t.href=='#'){(function(){A.hide();}).defer(100);}},onMouseOver:function(e){var t=this.findTargetItem(e);this.fireEvent("mouseover",this,e,t);},isVisible:function(){return !this.hidden;
 },onMouseOut:function(e){var t=this.findTargetItem(e);this.fireEvent("mouseout",this,e,t);},show:function(el,A,B){if(false===this.fireEvent("beforeshow",this)){Roo.log("show canceled");return;}this.parentMenu=B;if(!this.el){this.render();}this.el.addClass('show');
 var xy=this.el.getAlignToXY(el,A);if(this.el.getWidth()+xy[0]>=Roo.lib.Dom.getViewWidth()){xy=this.el.getAlignToXY(el,this.align.replace('/l/g','r'))}if(xy[0]<0){xy=this.el.getAlignToXY(el,this.align.replace('/r/g','l'))}if(this.el.getHeight()+xy[1]>=Roo.lib.Dom.getViewHeight()||xy[1]<0){var a=this.align.replace('?','').split('-');
-xy=this.el.getAlignToXY(el,a[1]+'-'+a[0]+'?')}this.showAt(xy,B,false);},showAt:function(xy,A,_e){this.parentMenu=A;if(!this.el){this.render();}if(_e!==false){this.fireEvent("beforeshow",this);}this.hideMenuItems();this.hidden=false;this.triggerEl.addClass('open');
-this.el.addClass('show');if(this.el.getStyle('top')!='auto'&&this.el.getStyle('top').slice(-1)!="%"){this.el.setXY(xy);}this.focus();this.fireEvent("show",this);},focus:function(){return;if(!this.hidden){this.doFocus.defer(50,this);}},doFocus:function(){if(!this.hidden){this.focusEl.focus();
-}},hide:function(A){if(false===this.fireEvent("beforehide",this)){Roo.log("hide canceled");return;}this.hideMenuItems();if(this.el&&this.isVisible()){if(this.activeItem){this.activeItem.deactivate();this.activeItem=null;}this.triggerEl.removeClass('open');
-;this.el.removeClass('show');this.hidden=true;this.fireEvent("hide",this);}if(A===true&&this.parentMenu){this.parentMenu.hide(true);}},onTriggerClick:function(e){Roo.log('trigger click');var A=e.getTarget();Roo.log(A.nodeName.toLowerCase());if(A.nodeName.toLowerCase()==='i'){e.preventDefault();
+xy=this.el.getAlignToXY(el,a[1]+'-'+a[0]+'?')}this.showAt(xy,B,false);},showAt:function(xy,A,_e){this.parentMenu=A;if(!this.el){this.render();}if(_e!==false){this.fireEvent("beforeshow",this);}this.hideMenuItems();this.hidden=false;if(this.triggerEl){this.triggerEl.addClass('open');
+}this.el.addClass('show');if(this.el.getStyle('top')!='auto'&&this.el.getStyle('top').slice(-1)!="%"){this.el.setXY(xy);}this.focus();this.fireEvent("show",this);},focus:function(){return;if(!this.hidden){this.doFocus.defer(50,this);}},doFocus:function(){if(!this.hidden){this.focusEl.focus();
+}},hide:function(A){if(false===this.fireEvent("beforehide",this)){Roo.log("hide canceled");return;}this.hideMenuItems();if(this.el&&this.isVisible()){if(this.activeItem){this.activeItem.deactivate();this.activeItem=null;}if(this.triggerEl){this.triggerEl.removeClass('open');
+}this.el.removeClass('show');this.hidden=true;this.fireEvent("hide",this);}if(A===true&&this.parentMenu){this.parentMenu.hide(true);}},onTriggerClick:function(e){Roo.log('trigger click');var A=e.getTarget();Roo.log(A.nodeName.toLowerCase());if(A.nodeName.toLowerCase()==='i'){e.preventDefault();
 }},onTriggerPress:function(e){Roo.log('trigger press');var A=Roo.get(e.getTarget());if(A.findParent('.dropdown-menu')||A.findParent('.treeview-menu')){Roo.log('is treeview or dropdown?');return;}if(e.getTarget().nodeName.toLowerCase()!=='i'&&this.isLink){return;
 }if(this.isVisible()){Roo.log('hide');this.hide();}else{Roo.log('show');this.show(this.triggerEl,this.align,false);}if(this.stopEvent||e.getTarget().nodeName.toLowerCase()==='i'){e.stopEvent();}},hideMenuItems:function(){Roo.log("hide Menu Items");if(!this.el){return;
 }this.el.select('.open',true).each(function(aa){aa.removeClass('open');});},addxtypeChild:function(A,B){var C=Roo.bootstrap.Menu.superclass.addxtypeChild.call(this,A,B);this.menuitems.add(C);return C;},getEl:function(){Roo.log(this.el);return this.el;},clear:function(){this.getEl().dom.innerHTML='';
@@ -304,8 +304,7 @@ Roo.bootstrap.PaginationItem=function(A){Roo.bootstrap.PaginationItem.superclass
 Roo.bootstrap.Slider=function(A){Roo.bootstrap.Slider.superclass.constructor.call(this,A);};Roo.extend(Roo.bootstrap.Slider,Roo.bootstrap.Component,{getAutoCreate:function(){var A={tag:'div',cls:'slider slider-sample1 vertical-handler ui-slider ui-slider-horizontal ui-widget ui-widget-content ui-corner-all',cn:[{tag:'a',cls:'ui-slider-handle ui-state-default ui-corner-all'}
 ]};return A;}});
 // Roo/grid/ColumnModel.js
-Roo.grid.ColumnModel=function(A){this.config=A;this.lookup={};for(var i=0,B=A.length;i<B;i++){var c=A[i];if(typeof c.dataIndex=="undefined"){c.dataIndex=i;}if(typeof c.renderer=="string"){c.renderer=Roo.util.Format[c.renderer];}if(typeof c.id=="undefined"){c.id=Roo.id();
-}if(c.editor&&c.editor.xtype){c.editor=Roo.factory(c.editor,Roo.grid);}if(c.editor&&c.editor.isFormField){c.editor=new Roo.grid.GridEditor(c.editor);}this.lookup[c.id]=c;}this.defaultWidth=100;this.defaultSortable=false;this.addEvents({"widthchange":true,"headerchange":true,"hiddenchange":true,"columnmoved":true,"columnlockchange":true}
+Roo.grid.ColumnModel=function(A){this.config=[];this.lookup={};for(var i=0,B=A.length;i<B;i++){this.addColumn(A[i]);}this.defaultWidth=100;this.defaultSortable=false;this.addEvents({"widthchange":true,"headerchange":true,"hiddenchange":true,"columnmoved":true,"columnlockchange":true}
 );Roo.grid.ColumnModel.superclass.constructor.call(this);};Roo.extend(Roo.grid.ColumnModel,Roo.util.Observable,{getColumnId:function(A){return this.config[A].id;},getColumnById:function(id){return this.lookup[id];},getColumnByDataIndex:function(A){var B=this.findColumnIndex(A);
 return B>-1?this.config[B]:false;},getIndexById:function(id){for(var i=0,A=this.config.length;i<A;i++){if(this.config[i].id==id){return i;}}return -1;},findColumnIndex:function(A){for(var i=0,B=this.config.length;i<B;i++){if(this.config[i].dataIndex==A){return i;
 }}return -1;},moveColumn:function(A,B){var c=this.config[A];this.config.splice(A,1);this.config.splice(B,0,c);this.dataMap=null;this.fireEvent("columnmoved",this,A,B);},isLocked:function(A){return this.config[A].locked===true;},setLocked:function(A,B,C){if(this.isLocked(A)==B){return;
@@ -317,8 +316,9 @@ for(var i=0,B=this.config.length;i<B;i++){var c=this.config[i];if(fn.call(A||thi
 },setColumnHeader:function(A,B){this.config[A].header=B;this.fireEvent("headerchange",this,A,B);},getColumnTooltip:function(A){return this.config[A].tooltip;},setColumnTooltip:function(A,B){this.config[A].tooltip=B;},getDataIndex:function(A){return this.config[A].dataIndex;
 },setDataIndex:function(A,B){this.config[A].dataIndex=B;},isCellEditable:function(A,B){return (this.config[A].editable||(typeof this.config[A].editable=="undefined"&&this.config[A].editor))?true:false;},getCellEditor:function(A,B){return this.config[A].editor;
 },setEditable:function(A,B){this.config[A].editable=B;},isHidden:function(A){return this.config[A].hidden;},isFixed:function(A){return this.config[A].fixed;},isResizable:function(A){return A>=0&&this.config[A].resizable!==false&&this.config[A].fixed!==true;
-},setHidden:function(A,B){this.config[A].hidden=B;this.totalWidth=null;this.fireEvent("hiddenchange",this,A,B);},setEditor:function(A,B){this.config[A].editor=B;}});Roo.grid.ColumnModel.defaultRenderer=function(A){if(typeof A=="object"){return A;}if(typeof A=="string"&&A.length<1){return "&#160;";
-}return String.format("{0}",A);};Roo.grid.DefaultColumnModel=Roo.grid.ColumnModel;
+},setHidden:function(A,B){this.config[A].hidden=B;this.totalWidth=null;this.fireEvent("hiddenchange",this,A,B);},setEditor:function(A,B){this.config[A].editor=B;},addColumn:function(c){var i=this.config.length;this.config[i]=c;if(typeof c.dataIndex=="undefined"){c.dataIndex=i;
+}if(typeof c.renderer=="string"){c.renderer=Roo.util.Format[c.renderer];}if(typeof c.id=="undefined"){c.id=Roo.id();}if(c.editor&&c.editor.xtype){c.editor=Roo.factory(c.editor,Roo.grid);}if(c.editor&&c.editor.isFormField){c.editor=new Roo.grid.GridEditor(c.editor);
+}this.lookup[c.id]=c;}});Roo.grid.ColumnModel.defaultRenderer=function(A){if(typeof A=="object"){return A;}if(typeof A=="string"&&A.length<1){return "&#160;";}return String.format("{0}",A);};Roo.grid.DefaultColumnModel=Roo.grid.ColumnModel;
 // Roo/LoadMask.js
 Roo.LoadMask=function(el,A){this.el=Roo.get(el);Roo.apply(this,A);if(this.store){this.store.on('beforeload',this.onBeforeLoad,this);this.store.on('load',this.onLoad,this);this.store.on('loadexception',this.onLoadException,this);this.removeMask=false;}else{var um=this.el.getUpdateManager();
 um.showLoadIndicator=false;um.on('beforeupdate',this.onBeforeLoad,this);um.on('update',this.onLoad,this);um.on('failure',this.onLoad,this);this.removeMask=true;}};Roo.LoadMask.prototype={msg:'Loading...',msgCls:'x-mask-loading',disabled:false,disable:function(){this.disabled=true;
@@ -335,7 +335,7 @@ this.ds=this.store;this.ds.xmodule=this.xmodule||false;}if(this.footer&&this.sto
 }if(this.condensed){A.cls+=' table-condensed';}if(this.responsive){A.cls+=' table-responsive';}if(this.cls){A.cls+=' '+this.cls;}var _t=this;var cp=['align','bgcolor','border','cellpadding','cellspacing','frame','rules','sortable','summary','width'].forEach(function(k){if(_t[k]){A[k]=_t[k];
 }});if(this.layout){A.style=(typeof(A.style)=='undefined')?('table-layout:'+this.layout+';'):(A.style+('table-layout:'+this.layout+';'));}if(this.store||this.cm){if(this.headerShow){A.cn.push(this.renderHeader());}A.cn.push(this.renderBody());if(this.footerShow){A.cn.push(this.renderFooter());
 }}return {cn:[A]};},initEvents:function(){if(!this.store||!this.cm){return;}if(this.selModel){this.selModel.initEvents();}this.mainBody=this.el.select('tbody',true).first();this.mainHead=this.el.select('thead',true).first();this.mainFoot=this.el.select('tfoot',true).first();
-var A=this;Roo.each(this.el.select('thead th.sortable',true).elements,function(e){e.on('click',A.sort,A);});this.mainBody.on("click",this.onClick,this);this.mainBody.on("dblclick",this.onDblClick,this);if(this.footer){this.footer.parentId=this.id;this.footer.onRender(this.el.select('tfoot tr td').first(),null);
+Roo.each(this.el.select('thead th.sortable',true).elements,function(e){e.on('click',this.sort,this);},this);this.mainBody.on("click",this.onClick,this);this.mainBody.on("dblclick",this.onDblClick,this);if(this.footer){this.footer.parentId=this.id;this.footer.onRender(this.el.select('tfoot tr td').first(),null);
 if(this.lazyLoad){this.el.select('tfoot tr td').first().addClass('hide');}}if(this.loadMask){this.maskEl=new Roo.LoadMask(this.el,{store:this.ds,msgCls:'roo-el-mask-msg'});}this.store.on('load',this.onLoad,this);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);this.mainBody.on('scroll',this.onBodyScroll,this);this.cm.on("headerchange",this.onHeaderChange,this);
 this.cm.on("hiddenchange",this.onHiddenChange,this,arguments);},onContextMenu:function(e,t){this.processEvent("contextmenu",e);},processEvent:function(A,e){if(A!='touchstart'){this.fireEvent(A,e);}var t=e.getTarget();var B=Roo.get(t);if(!B){return;}if(B.findParent('tfoot',false,true)){return;
@@ -347,15 +347,15 @@ var F=E.dom.rowIndex-1;if(E!==false){this.fireEvent("row"+A,this,F,e);if(B!==fal
 }if(!A||typeof(A)=='undefined'){return;}var B=A.findParent('tr',false,true);if(!B||typeof(B)=='undefined'){return;}var C=A.dom.cellIndex;var D=this.getRowIndex(B);if(this.cellSelection){this.fireEvent('cellclick',this,A,D,C,e);}if(this.rowSelection){this.fireEvent('rowclick',this,B,D,e);
 }},onDblClick:function(e,el){var A=Roo.get(el);if(!A||(!this.cellSelection&&!this.rowSelection)){return;}if(e.getTarget().nodeName.toLowerCase()!='td'){A=A.findParent('td',false,true);}if(!A||typeof(A)=='undefined'){return;}var B=A.findParent('tr',false,true);
 if(!B||typeof(B)=='undefined'){return;}var C=A.dom.cellIndex;var D=this.getRowIndex(B);if(this.cellSelection){this.fireEvent('celldblclick',this,A,D,C,e);}if(this.rowSelection){this.fireEvent('rowdblclick',this,B,D,e);}},sort:function(e,el){var A=Roo.get(el);
-if(!A.hasClass('sortable')){return;}var B=A.attr('sort');var C='ASC';if(A.select('i',true).first().hasClass('glyphicon-arrow-up')){C='DESC';}this.store.sortInfo={field:B,direction:C};if(this.footer){Roo.log("calling footer first");this.footer.onClick('first');
-}else{this.store.load({params:{start:0}});}},renderHeader:function(){var A={tag:'thead',cn:[]};var cm=this.cm;this.totalWidth=0;for(var i=0,B=cm.getColumnCount();i<B;i++){var C=cm.config[i];var c={tag:'th',cls:'x-hcol-'+i,style:'',html:cm.getColumnHeader(i)}
-;var hh='';if(typeof(C.sortable)!='undefined'&&C.sortable){c.cls='sortable';c.html='<i class="glyphicon"></i>'+c.html;}if(typeof(C.lgHeader)!='undefined'){hh+='<span class="hidden-xs hidden-sm hidden-md ">'+C.lgHeader+'</span>';}if(typeof(C.mdHeader)!='undefined'){hh+='<span class="hidden-xs hidden-sm hidden-lg">'+C.mdHeader+'</span>';
+if(!A.hasClass('sortable')){return;}var B=A.attr('sort');var C='ASC';if(A.select('i',true).first().hasClass('fa-arrow-up')){C='DESC';}this.store.sortInfo={field:B,direction:C};if(this.footer){Roo.log("calling footer first");this.footer.onClick('first');}else{this.store.load({params:{start:0}
+});}},renderHeader:function(){var A={tag:'thead',cn:[]};var cm=this.cm;this.totalWidth=0;for(var i=0,B=cm.getColumnCount();i<B;i++){var C=cm.config[i];var c={tag:'th',cls:'x-hcol-'+i,style:'',html:cm.getColumnHeader(i)};var D=cm.getColumnTooltip(i);if(D){c.tooltip=D;
+}var hh='';if(typeof(C.sortable)!='undefined'&&C.sortable){c.cls='sortable';c.html='<i class="fa"></i>'+c.html;}if(typeof(C.lgHeader)!='undefined'){hh+='<span class="hidden-xs hidden-sm hidden-md ">'+C.lgHeader+'</span>';}if(typeof(C.mdHeader)!='undefined'){hh+='<span class="hidden-xs hidden-sm hidden-lg">'+C.mdHeader+'</span>';
 }if(typeof(C.smHeader)!='undefined'){hh+='<span class="hidden-xs hidden-md hidden-lg">'+C.smHeader+'</span>';}if(typeof(C.xsHeader)!='undefined'){hh+='<span class="hidden-sm hidden-md hidden-lg">'+C.xsHeader+'</span>';}if(hh.length){c.html=hh;}if(typeof(C.tooltip)!='undefined'){c.tooltip=C.tooltip;
 }if(typeof(C.colspan)!='undefined'){c.colspan=C.colspan;}if(typeof(C.hidden)!='undefined'&&C.hidden){c.style+=' display:none;';}if(typeof(C.dataIndex)!='undefined'){c.sort=C.dataIndex;}if(typeof(C.align)!='undefined'&&C.align.length){c.style+=' text-align:'+C.align+';';
-}if(typeof(C.width)!='undefined'){c.style+=' width:'+C.width+'px;';this.totalWidth+=C.width;}else{this.totalWidth+=100;}if(typeof(C.cls)!='undefined'){c.cls=(typeof(c.cls)=='undefined')?C.cls:(c.cls+' '+C.cls);}['xs','sm','md','lg'].map(function(D){if(typeof(C[D])=='undefined'){return;
-}if(!C[D]){c.cls+=' hidden-'+D+' hidden'+D+'-down';return;}c.cls+=' col-'+D+'-'+C[D]+(D=='xs'?(' col-'+C[D]):'');});A.cn.push(c)}return A;},renderBody:function(){var A={tag:'tbody',cn:[{tag:'tr',cn:[{tag:'td',colspan:this.cm.getColumnCount()}]}]};return A;
-},renderFooter:function(){var A={tag:'tfoot',cn:[{tag:'tr',cn:[{tag:'td',colspan:this.cm.getColumnCount()}]}]};return A;},onLoad:function(){this.clear();var A=this;var cm=this.cm;var ds=this.store;Roo.each(this.el.select('thead th.sortable',true).elements,function(e){e.select('i',true).removeClass(['glyphicon-arrow-up','glyphicon-arrow-down']);
-if(A.store.sortInfo){if(e.hasClass('sortable')&&e.attr('sort')==A.store.sortInfo.field&&A.store.sortInfo.direction.toUpperCase()=='ASC'){e.select('i',true).addClass(['glyphicon-arrow-up']);}if(e.hasClass('sortable')&&e.attr('sort')==A.store.sortInfo.field&&A.store.sortInfo.direction.toUpperCase()=='DESC'){e.select('i',true).addClass(['glyphicon-arrow-down']);
+}if(typeof(C.width)!='undefined'){c.style+=' width:'+C.width+'px;';this.totalWidth+=C.width;}else{this.totalWidth+=100;}if(typeof(C.cls)!='undefined'){c.cls=(typeof(c.cls)=='undefined')?C.cls:(c.cls+' '+C.cls);}['xs','sm','md','lg'].map(function(E){if(typeof(C[E])=='undefined'){return;
+}if(!C[E]){c.cls+=' hidden-'+E+' hidden'+E+'-down';return;}c.cls+=' col-'+E+'-'+C[E]+(E=='xs'?(' col-'+C[E]):'');});A.cn.push(c)}return A;},renderBody:function(){var A={tag:'tbody',cn:[{tag:'tr',cn:[{tag:'td',colspan:this.cm.getColumnCount()}]}]};return A;
+},renderFooter:function(){var A={tag:'tfoot',cn:[{tag:'tr',cn:[{tag:'td',colspan:this.cm.getColumnCount()}]}]};return A;},onLoad:function(){this.clear();var A=this;var cm=this.cm;var ds=this.store;Roo.each(this.el.select('thead th.sortable',true).elements,function(e){e.select('i',true).removeClass(['fa-arrow-up','fa-arrow-down']);
+if(A.store.sortInfo){if(e.hasClass('sortable')&&e.attr('sort')==A.store.sortInfo.field&&A.store.sortInfo.direction.toUpperCase()=='ASC'){e.select('i',true).addClass(['fa-arrow-up']);}if(e.hasClass('sortable')&&e.attr('sort')==A.store.sortInfo.field&&A.store.sortInfo.direction.toUpperCase()=='DESC'){e.select('i',true).addClass(['fa-arrow-down']);
 }}});var B=this.mainBody;if(ds.getCount()>0){ds.data.each(function(d,E){var F=this.renderRow(cm,ds,E);B.createChild(F);var G=this;if(F.cellObjects.length){Roo.each(F.cellObjects,function(r){G.renderCellObject(r);})}},this);}var C=this.el.select('tfoot',true).first();
 if(this.footerShow&&this.auto_hide_footer&&this.mainFoot){this.mainFoot.setVisibilityMode(Roo.Element.DISPLAY).hide();var D=this.ds.getTotalCount();if(this.footer.pageSize<D){this.mainFoot.show();}}Roo.each(this.el.select('tbody td',true).elements,function(e){e.on('mouseover',A.onMouseover,A);
 });Roo.each(this.el.select('tbody td',true).elements,function(e){e.on('mouseout',A.onMouseout,A);});this.fireEvent('rowsrendered',this);this.autoSize();},onUpdate:function(ds,A){this.refreshRow(A);this.autoSize();},onRemove:function(ds,A,B,C){if(C!==true){this.fireEvent("beforerowremoved",this,B,A);
@@ -374,11 +374,12 @@ var t=r.cfg.render(r.container);if(r.cfg.cn){Roo.each(r.cfg.cn,function(c){var B
 var cw=A.getWidth();this.getGridEl().select('tfoot tr, tfoot  td',true).setWidth(cw);if(C){C.setWidth(A.getWidth());var E=(C.dom.offsetWidth-C.dom.clientWidth);cw-=E;}cw=Math.max(cw,this.totalWidth);this.getGridEl().select('tbody tr',true).setWidth(cw);return;
 },onBodyScroll:function(){if(this.mainHead){this.mainHead.setStyle({'position':'relative','left':(-1*this.mainBody.dom.scrollLeft)+'px'});}if(this.lazyLoad){var A=this.mainBody.dom.scrollHeight;var B=Math.ceil(this.mainBody.getScroll().top);var C=this.mainBody.getHeight();
 if(A-C==B){var D=this.ds.getTotalCount();if(this.footer.cursor+this.footer.pageSize<D){this.footer.ds.load({params:{start:this.footer.cursor+this.footer.pageSize,limit:this.footer.pageSize},add:true});}}}},onHeaderChange:function(){var A=this.renderHeader();
-var B=this.el.select('table',true).first();this.mainHead.remove();this.mainHead=B.createChild(A,this.mainBody,false);},onHiddenChange:function(A,B,C){var D='#'+this.id+' .x-hcol-'+B;var E='#'+this.id+' .x-col-'+B;this.CSS.updateRule(D,"display","");this.CSS.updateRule(E,"display","");
-if(C){this.CSS.updateRule(D,"display","none");this.CSS.updateRule(E,"display","none");}this.onHeaderChange();this.onLoad();},setColumnWidth:function(A,B){if(!this.colModel.config[A]){return;}var w=B.split(" ");var C=this.el.dom.getElementsByClassName("x-col-"+A);
-var D=this.el.dom.getElementsByClassName("x-hcol-"+A);for(var j=0;j<w.length;j++){if(!w[j]){continue;}var E=w[j].split("-");if(!Number.isInteger(E[1]*1)){continue;}if(!this.colModel.config[A][E[0]]){continue;}if(!D[0].classList.contains("col-"+E[0]+"-"+this.colModel.config[A][E[0]])){continue;
-}D[0].classList.replace("col-"+E[0]+"-"+this.colModel.config[A][E[0]],"col-"+E[0]+"-"+E[1]);for(var i=0;i<C.length;i++){var E=w[j].split("-");if(!Number.isInteger(E[1]*1)){continue;}if(!this.colModel.config[A][E[0]]){continue;}if(!C[i].classList.contains("col-"+E[0]+"-"+this.colModel.config[A][E[0]])){continue;
-}C[i].classList.replace("col-"+E[0]+"-"+this.colModel.config[A][E[0]],"col-"+E[0]+"-"+E[1]);}this.colModel.config[A][E[0]]=E[1];}}});
+var B=this.el.select('table',true).first();this.mainHead.remove();this.mainHead=B.createChild(A,this.mainBody,false);Roo.each(this.el.select('thead th.sortable',true).elements,function(e){e.on('click',this.sort,this);},this);},onHiddenChange:function(A,B,C){var D='#'+this.id+' .x-hcol-'+B;
+var E='#'+this.id+' .x-col-'+B;this.CSS.updateRule(D,"display","");this.CSS.updateRule(E,"display","");if(C){this.CSS.updateRule(D,"display","none");this.CSS.updateRule(E,"display","none");}this.onHeaderChange();this.onLoad();},setColumnWidth:function(A,B){if(!this.colModel.config[A]){return;
+}var w=B.split(" ");var C=this.el.dom.getElementsByClassName("x-col-"+A);var D=this.el.dom.getElementsByClassName("x-hcol-"+A);for(var j=0;j<w.length;j++){if(!w[j]){continue;}var E=w[j].split("-");if(!Number.isInteger(E[1]*1)){continue;}if(!this.colModel.config[A][E[0]]){continue;
+}if(!D[0].classList.contains("col-"+E[0]+"-"+this.colModel.config[A][E[0]])){continue;}D[0].classList.replace("col-"+E[0]+"-"+this.colModel.config[A][E[0]],"col-"+E[0]+"-"+E[1]);for(var i=0;i<C.length;i++){var E=w[j].split("-");if(!Number.isInteger(E[1]*1)){continue;
+}if(!this.colModel.config[A][E[0]]){continue;}if(!C[i].classList.contains("col-"+E[0]+"-"+this.colModel.config[A][E[0]])){continue;}C[i].classList.replace("col-"+E[0]+"-"+this.colModel.config[A][E[0]],"col-"+E[0]+"-"+E[1]);}this.colModel.config[A][E[0]]=E[1];
+}}});
 // Roo/bootstrap/TableCell.js
 Roo.bootstrap.TableCell=function(A){Roo.bootstrap.TableCell.superclass.constructor.call(this,A);};Roo.extend(Roo.bootstrap.TableCell,Roo.bootstrap.Component,{html:false,cls:false,tag:false,abbr:false,align:false,axis:false,bgcolor:false,charoff:false,colspan:false,headers:false,height:false,nowrap:false,rowspan:false,scope:false,valign:false,width:false,getAutoCreate:function(){var A=Roo.apply({}
 ,Roo.bootstrap.TableCell.superclass.getAutoCreate.call(this));A={tag:'td'};if(this.tag){A.tag=this.tag;}if(this.html){A.html=this.html}if(this.cls){A.cls=this.cls}if(this.abbr){A.abbr=this.abbr}if(this.align){A.align=this.align}if(this.axis){A.axis=this.axis}
@@ -663,9 +664,9 @@ this.store.on('loadexception',this.onLoadException,this);if(this.editable){this.
 }this.indicator=this.indicatorEl();if(this.indicator){this.indicator.setVisibilityMode(Roo.Element.DISPLAY);this.indicator.hide();}},onDestroy:function(){if(this.view){this.view.setStore(null);this.view.el.removeAllListeners();this.view.el.remove();this.view.purgeListeners();
 }if(this.list){this.list.dom.innerHTML='';}if(this.store){this.store.un('beforeload',this.onBeforeLoad,this);this.store.un('load',this.onLoad,this);this.store.un('loadexception',this.onLoadException,this);}Roo.bootstrap.ComboBox.superclass.onDestroy.call(this);
 },fireKey:function(e){if(e.isNavKeyPress()&&!this.list.isVisible()){this.fireEvent("specialkey",this,e);}},onResize:function(w,h){},setEditable:function(A){if(A==this.editable){return;}this.editable=A;if(!A){this.inputEl().dom.setAttribute('readOnly',true);
-this.inputEl().on('mousedown',this.onTriggerClick,this);this.inputEl().addClass('x-combo-noedit');}else{this.inputEl().dom.setAttribute('readOnly',false);this.inputEl().un('mousedown',this.onTriggerClick,this);this.inputEl().removeClass('x-combo-noedit');
-}},onBeforeLoad:function(A,B){if(!this.hasFocus){return;}if(!B.add){this.list.dom.innerHTML='<li class="loading-indicator">'+(this.loadingText||'loading')+'</li>';}this.restrictHeight();this.selectedIndex=-1;},onLoad:function(){this.hasQuery=false;if(!this.hasFocus){return;
-}if(typeof(this.loading)!=='undefined'&&this.loading!==null){this.loading.hide();}if(this.store.getCount()>0){this.expand();this.restrictHeight();if(this.lastQuery==this.allQuery){if(this.editable&&!this.tickable){this.inputEl().dom.select();}if(!this.selectByValue(this.value,true)&&this.autoFocus&&(!this.store.lastOptions||typeof(this.store.lastOptions.add)=='undefined'||this.store.lastOptions.add!=true)){this.select(0,true);
+this.inputEl().on('mousedown',this.onTriggerClick,this);this.inputEl().addClass('x-combo-noedit');}else{this.inputEl().dom.removeAttribute('readOnly');this.inputEl().un('mousedown',this.onTriggerClick,this);this.inputEl().removeClass('x-combo-noedit');}},onBeforeLoad:function(A,B){if(!this.hasFocus){return;
+}if(!B.add){this.list.dom.innerHTML='<li class="loading-indicator">'+(this.loadingText||'loading')+'</li>';}this.restrictHeight();this.selectedIndex=-1;},onLoad:function(){this.hasQuery=false;if(!this.hasFocus){return;}if(typeof(this.loading)!=='undefined'&&this.loading!==null){this.loading.hide();
+}if(this.store.getCount()>0){this.expand();this.restrictHeight();if(this.lastQuery==this.allQuery){if(this.editable&&!this.tickable){this.inputEl().dom.select();}if(!this.selectByValue(this.value,true)&&this.autoFocus&&(!this.store.lastOptions||typeof(this.store.lastOptions.add)=='undefined'||this.store.lastOptions.add!=true)){this.select(0,true);
 }}else{if(this.autoFocus){this.selectNext();}if(this.typeAhead&&this.lastKey!=Roo.EventObject.BACKSPACE&&this.lastKey!=Roo.EventObject.DELETE){this.taTask.delay(this.typeAheadDelay);}}}else{this.onEmptyResults();}},onLoadException:function(){this.hasQuery=false;
 if(typeof(this.loading)!=='undefined'&&this.loading!==null){this.loading.hide();}if(this.tickable&&this.editable){return;}this.collapse();},onTypeAhead:function(){if(this.store.getCount()>0){var r=this.store.getAt(0);var A=r.data[this.displayField];var B=A.length;
 var C=this.getRawValue().length;if(C!=B){this.setRawValue(A);this.selectText(C,A.length);}}},onSelect:function(A,B){if(this.fireEvent('beforeselect',this,A,B)!==false){this.setFromData(B>-1?A.data:false);this.collapse();this.fireEvent('select',this,A,B);}
@@ -716,34 +717,33 @@ this.lastItem=Roo.apply([],this.item);if(A&&A.name=='cancel'){this.tickItems=Roo
 );}if(this.removable&&!this.multiple){C.cls+=' roo-removable';C.cn.push({tag:'button',html:'x',cls:'roo-combo-removable-btn close'});}if(this.hasFeedback&&!this.allowBlank){C.cls+=' has-feedback';C.cn.push({tag:'span',cls:'glyphicon form-control-feedback'}
 );}if(this.after){C.cls+=(this.before)?'':' input-group';C.cn.push({tag:'span',cls:'input-group-addon input-group-append input-group-text',html:this.after});}var D=C;if(this.multiple){D={tag:'ul',cls:'roo-select2-choices',cn:[{tag:'li',cls:'roo-select2-search-field',cn:[C]}
 ]};}var E={cls:'roo-select2-container input-group roo-touchview-combobox ',cn:[{tag:'input',type:'hidden',cls:'form-hidden-field'},D]};if(!this.multiple&&this.showToggleBtn){var F={cls:'caret'};if(this.caret!=false){F={tag:'i',cls:'fa fa-'+this.caret};}E.cn.push({tag:'span',cls:'input-group-addon input-group-append input-group-text btn dropdown-toggle',cn:[Roo.bootstrap.version==3?F:'',{tag:'span',cls:'combobox-clear',cn:[{tag:'i',cls:'icon-remove'}
-]}]})}if(this.multiple){E.cls+=' roo-select2-container-multi';}var G=this.labelAlign||this.parentLabelAlign();if(G==='left'&&this.fieldLabel.length){A.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 col-form-label',html:this.fieldLabel},{cls:'roo-combobox-wrap ',cn:[E]}];var H=A.cn[1];var I=A.cn[2];if(this.indicatorpos=='right'){A.cn=[{tag:'label','for':id,cls:'control-label col-form-label',cn:[{tag:'span',html:this.fieldLabel}
-,{tag:'i',cls:'roo-required-indicator right-indicator text-danger fa fa-lg fa-star',tooltip:'This field is required'}]},{cls:"roo-combobox-wrap ",cn:[E]}];H=A.cn[0];I=A.cn[1];}if(this.labelWidth>12){H.style="width: "+this.labelWidth+'px';}if(this.labelWidth<13&&this.labelmd==0){this.labelmd=this.labelWidth;
-}if(this.labellg>0){H.cls+=' col-lg-'+this.labellg;I.cls+=' col-lg-'+(12-this.labellg);}if(this.labelmd>0){H.cls+=' col-md-'+this.labelmd;I.cls+=' col-md-'+(12-this.labelmd);}if(this.labelsm>0){H.cls+=' col-sm-'+this.labelsm;I.cls+=' col-sm-'+(12-this.labelsm);
-}if(this.labelxs>0){H.cls+=' col-xs-'+this.labelxs;I.cls+=' col-xs-'+(12-this.labelxs);}}else if(this.fieldLabel.length){A.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',html:this.fieldLabel}
-,{cls:'',cn:[E]}];if(this.indicatorpos=='right'){A.cn=[{tag:'label',cls:'control-label',html:this.fieldLabel,cn:[{tag:'i',cls:'roo-required-indicator right-indicator text-danger fa fa-lg fa-star',tooltip:'This field is required'}]},{cls:'',cn:[E]}];}}else{A.cn=E;
-}var J=this;['xs','sm','md','lg'].map(function(K){if(J[K]){A.cls+=' col-'+K+'-'+J[K];}});return A;},initTouchView:function(){this.renderTouchView();this.touchViewEl.on('scroll',function(){this.el.dom.scrollTop=0;},this);this.originalValue=this.getValue();
-this.triggerEl=this.el.select('span.dropdown-toggle',true).first();this.inputEl().on("click",this.showTouchView,this);if(this.triggerEl){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);this.maskEl=new Roo.LoadMask(this.touchViewEl,{store:this.store,msgCls:'roo-el-mask-msg'});this.store.on('beforeload',this.onTouchViewBeforeLoad,this);
-this.store.on('load',this.onTouchViewLoad,this);this.store.on('loadexception',this.onTouchViewLoadException,this);if(this.hiddenName){this.hiddenField=this.el.select('input.form-hidden-field',true).first();this.hiddenField.dom.value=this.hiddenValue!==undefined?this.hiddenValue:this.value!==undefined?this.value:'';
-this.el.dom.removeAttribute('name');this.hiddenField.dom.setAttribute('name',this.hiddenName);}if(this.multiple){this.choices=this.el.select('ul.roo-select2-choices',true).first();this.searchField=this.el.select('ul li.roo-select2-search-field',true).first();
-}if(this.removable&&!this.multiple){var A=this.closeTriggerEl();if(A){A.setVisibilityMode(Roo.Element.DISPLAY).hide();A.on('click',this.removeBtnClick,this,A);}}this.inputEl().on("focus",function(e){document.activeElement.blur();},this);this._touchViewMask=Roo.DomHelper.append(document.body,{tag:"div",cls:"x-dlg-mask"}
-,true);return;},renderTouchView:function(){this.touchViewEl=Roo.get(document.body).createChild(Roo.bootstrap.ComboBox.touchViewTemplate);this.touchViewEl.setVisibilityMode(Roo.Element.DISPLAY).originalDisplay='block';this.touchViewHeaderEl=this.touchViewEl.select('.modal-header',true).first();
-this.touchViewHeaderEl.setVisibilityMode(Roo.Element.DISPLAY).originalDisplay='block';this.touchViewBodyEl=this.touchViewEl.select('.modal-body',true).first();this.touchViewBodyEl.setVisibilityMode(Roo.Element.DISPLAY).originalDisplay='block';this.touchViewBodyEl.setStyle('overflow','auto');
-this.touchViewListGroup=this.touchViewBodyEl.select('.list-group',true).first();this.touchViewListGroup.setVisibilityMode(Roo.Element.DISPLAY).originalDisplay='block';this.touchViewFooterEl=this.touchViewEl.select('.modal-footer',true).first();this.touchViewFooterEl.setVisibilityMode(Roo.Element.DISPLAY).originalDisplay='block';
-},showTouchView:function(){if(this.disabled){return;}this.touchViewHeaderEl.hide();if(this.modalTitle.length){this.touchViewHeaderEl.dom.innerHTML=this.modalTitle;this.touchViewHeaderEl.show();}this.touchViewEl.setStyle('z-index',Roo.bootstrap.Modal.zIndex++);
-this.touchViewEl.show();this.touchViewEl.select('.modal-dialog',true).first().setStyle({margin:'0px',width:'100%'});var A=Roo.lib.Dom.getViewHeight()-this.touchViewFooterEl.getHeight()+this.touchViewBodyEl.getPadding('tb');if(this.modalTitle.length){A=A-this.touchViewHeaderEl.getHeight();
-}this.touchViewBodyEl.setHeight(A);if(this.animate){var B=this;(function(){B.touchViewEl.addClass(['in','show']);}).defer(50);}else{this.touchViewEl.addClass(['in','show']);}if(this._touchViewMask){Roo.get(document.body).addClass("x-body-masked");this._touchViewMask.setSize(Roo.lib.Dom.getViewWidth(true),Roo.lib.Dom.getViewHeight(true));
-this._touchViewMask.setStyle('z-index',10000);this._touchViewMask.addClass('show');}this.doTouchViewQuery();},hideTouchView:function(){this.touchViewEl.removeClass(['in','show']);if(this.animate){var A=this;(function(){A.touchViewEl.setStyle('display','none');
-}).defer(150);}else{this.touchViewEl.setStyle('display','none');}if(this._touchViewMask){this._touchViewMask.removeClass('show');Roo.get(document.body).removeClass("x-body-masked");}},setTouchViewValue:function(){if(this.multiple){this.clearItem();var A=this;
-Roo.each(this.tickItems,function(o){this.addItem(o);},this);}this.hideTouchView();},doTouchViewQuery:function(){var qe={query:'',forceAll:true,combo:this,cancel:false};if(this.fireEvent('beforequery',qe)===false||qe.cancel){return false;}if(!this.alwaysQuery||this.mode=='local'){this.onTouchViewLoad();
-return;}this.store.load();},onTouchViewBeforeLoad:function(A,B){return;},onTouchViewLoad:function(){if(this.store.getCount()<1){this.onTouchViewEmptyResults();return;}this.clearTouchView();var A=this.getRawValue();var B=(this.multiple)?Roo.bootstrap.ComboBox.listItemCheckbox:Roo.bootstrap.ComboBox.listItemRadio;
-this.tickItems=[];this.store.data.each(function(d,G){var H=this.touchViewListGroup.createChild(B);if(typeof(d.data.cls)!='undefined'&&d.data.cls.length){H.addClass(d.data.cls);}if(this.displayField&&typeof(d.data[this.displayField])!='undefined'){var I={data:d.data,html:d.data[this.displayField]}
-;if(this.fireEvent('touchviewdisplay',this,I)!==false){H.select('.roo-combobox-list-group-item-value',true).first().dom.innerHTML=I.html;}}H.removeClass('selected');if(!this.multiple&&this.valueField&&typeof(d.data[this.valueField])!='undefined'&&d.data[this.valueField]==this.getValue()){H.select('.roo-combobox-list-group-item-box > input',true).first().attr('checked',true);
-H.addClass('selected');}if(this.multiple&&this.valueField&&typeof(d.data[this.valueField])!='undefined'&&this.getValue().indexOf(d.data[this.valueField])!=-1){H.select('.roo-combobox-list-group-item-box > input',true).first().attr('checked',true);this.tickItems.push(d.data);
-}H.on('click',this.onTouchViewClick,this,{row:H,rowIndex:G});},this);var C=this.touchViewListGroup.select('.list-group-item > .roo-combobox-list-group-item-box > input:checked',true).first();var D=Roo.lib.Dom.getViewHeight()-this.touchViewFooterEl.getHeight()+this.touchViewBodyEl.getPadding('tb');
-if(this.modalTitle.length){D=D-this.touchViewHeaderEl.getHeight();}var E=this.touchViewListGroup.getHeight()+this.touchViewBodyEl.getPadding('tb')*2;if(this.mobile_restrict_height&&E<D){this.touchViewBodyEl.setHeight(E);}var F=this;if(C&&E>D){(function(){C.findParent('li').scrollIntoView(F.touchViewListGroup.dom);
-}).defer(500);}},onTouchViewLoadException:function(){this.hideTouchView();},onTouchViewEmptyResults:function(){this.clearTouchView();this.touchViewListGroup.createChild(Roo.bootstrap.ComboBox.emptyResult);this.touchViewListGroup.select('.roo-combobox-touch-view-empty-result',true).first().dom.innerHTML=this.emptyResultText;
+]}]})}if(this.multiple){E.cls+=' roo-select2-container-multi';}var G=this.allowBlank?{tag:'i',style:'display: none'}:{tag:'i',cls:'roo-required-indicator left-indicator text-danger fa fa-lg fa-star',tooltip:'This field is required'};var H=this.labelAlign||this.parentLabelAlign();
+if(H==='left'&&this.fieldLabel.length){A.cn=[G,{tag:'label',cls:'control-label col-form-label',html:this.fieldLabel},{cls:'roo-combobox-wrap ',cn:[E]}];var I=A.cn[1];var J=A.cn[2];if(this.indicatorpos=='right'){A.cn=[{tag:'label','for':id,cls:'control-label col-form-label',cn:[{tag:'span',html:this.fieldLabel}
+,G]},{cls:"roo-combobox-wrap ",cn:[E]}];I=A.cn[0];J=A.cn[1];}if(this.labelWidth>12){I.style="width: "+this.labelWidth+'px';}if(this.labelWidth<13&&this.labelmd==0){this.labelmd=this.labelWidth;}if(this.labellg>0){I.cls+=' col-lg-'+this.labellg;J.cls+=' col-lg-'+(12-this.labellg);
+}if(this.labelmd>0){I.cls+=' col-md-'+this.labelmd;J.cls+=' col-md-'+(12-this.labelmd);}if(this.labelsm>0){I.cls+=' col-sm-'+this.labelsm;J.cls+=' col-sm-'+(12-this.labelsm);}if(this.labelxs>0){I.cls+=' col-xs-'+this.labelxs;J.cls+=' col-xs-'+(12-this.labelxs);
+}}else if(this.fieldLabel.length){A.cn=[G,{tag:'label',cls:'control-label',html:this.fieldLabel},{cls:'',cn:[E]}];if(this.indicatorpos=='right'){A.cn=[{tag:'label',cls:'control-label',html:this.fieldLabel,cn:[G]},{cls:'',cn:[E]}];}}else{A.cn=E;}var K=this;
+['xs','sm','md','lg'].map(function(L){if(K[L]){A.cls+=' col-'+L+'-'+K[L];}});return A;},initTouchView:function(){this.renderTouchView();this.touchViewEl.on('scroll',function(){this.el.dom.scrollTop=0;},this);this.originalValue=this.getValue();this.triggerEl=this.el.select('span.dropdown-toggle',true).first();
+this.inputEl().on("click",this.showTouchView,this);if(this.triggerEl){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);
+this.maskEl=new Roo.LoadMask(this.touchViewEl,{store:this.store,msgCls:'roo-el-mask-msg'});this.store.on('beforeload',this.onTouchViewBeforeLoad,this);this.store.on('load',this.onTouchViewLoad,this);this.store.on('loadexception',this.onTouchViewLoadException,this);
+if(this.hiddenName){this.hiddenField=this.el.select('input.form-hidden-field',true).first();this.hiddenField.dom.value=this.hiddenValue!==undefined?this.hiddenValue:this.value!==undefined?this.value:'';this.el.dom.removeAttribute('name');this.hiddenField.dom.setAttribute('name',this.hiddenName);
+}if(this.multiple){this.choices=this.el.select('ul.roo-select2-choices',true).first();this.searchField=this.el.select('ul li.roo-select2-search-field',true).first();}if(this.removable&&!this.multiple){var A=this.closeTriggerEl();if(A){A.setVisibilityMode(Roo.Element.DISPLAY).hide();
+A.on('click',this.removeBtnClick,this,A);}}this.inputEl().on("focus",function(e){document.activeElement.blur();},this);this._touchViewMask=Roo.DomHelper.append(document.body,{tag:"div",cls:"x-dlg-mask"},true);return;},renderTouchView:function(){this.touchViewEl=Roo.get(document.body).createChild(Roo.bootstrap.ComboBox.touchViewTemplate);
+this.touchViewEl.setVisibilityMode(Roo.Element.DISPLAY).originalDisplay='block';this.touchViewHeaderEl=this.touchViewEl.select('.modal-header',true).first();this.touchViewHeaderEl.setVisibilityMode(Roo.Element.DISPLAY).originalDisplay='block';this.touchViewBodyEl=this.touchViewEl.select('.modal-body',true).first();
+this.touchViewBodyEl.setVisibilityMode(Roo.Element.DISPLAY).originalDisplay='block';this.touchViewBodyEl.setStyle('overflow','auto');this.touchViewListGroup=this.touchViewBodyEl.select('.list-group',true).first();this.touchViewListGroup.setVisibilityMode(Roo.Element.DISPLAY).originalDisplay='block';
+this.touchViewFooterEl=this.touchViewEl.select('.modal-footer',true).first();this.touchViewFooterEl.setVisibilityMode(Roo.Element.DISPLAY).originalDisplay='block';},showTouchView:function(){if(this.disabled){return;}this.touchViewHeaderEl.hide();if(this.modalTitle.length){this.touchViewHeaderEl.dom.innerHTML=this.modalTitle;
+this.touchViewHeaderEl.show();}this.touchViewEl.setStyle('z-index',Roo.bootstrap.Modal.zIndex++);this.touchViewEl.show();this.touchViewEl.select('.modal-dialog',true).first().setStyle({margin:'0px',width:'100%'});var A=Roo.lib.Dom.getViewHeight()-this.touchViewFooterEl.getHeight()+this.touchViewBodyEl.getPadding('tb');
+if(this.modalTitle.length){A=A-this.touchViewHeaderEl.getHeight();}this.touchViewBodyEl.setHeight(A);if(this.animate){var B=this;(function(){B.touchViewEl.addClass(['in','show']);}).defer(50);}else{this.touchViewEl.addClass(['in','show']);}if(this._touchViewMask){Roo.get(document.body).addClass("x-body-masked");
+this._touchViewMask.setSize(Roo.lib.Dom.getViewWidth(true),Roo.lib.Dom.getViewHeight(true));this._touchViewMask.setStyle('z-index',10000);this._touchViewMask.addClass('show');}this.doTouchViewQuery();},hideTouchView:function(){this.touchViewEl.removeClass(['in','show']);
+if(this.animate){var A=this;(function(){A.touchViewEl.setStyle('display','none');}).defer(150);}else{this.touchViewEl.setStyle('display','none');}if(this._touchViewMask){this._touchViewMask.removeClass('show');Roo.get(document.body).removeClass("x-body-masked");
+}},setTouchViewValue:function(){if(this.multiple){this.clearItem();var A=this;Roo.each(this.tickItems,function(o){this.addItem(o);},this);}this.hideTouchView();},doTouchViewQuery:function(){var qe={query:'',forceAll:true,combo:this,cancel:false};if(this.fireEvent('beforequery',qe)===false||qe.cancel){return false;
+}if(!this.alwaysQuery||this.mode=='local'){this.onTouchViewLoad();return;}this.store.load();},onTouchViewBeforeLoad:function(A,B){return;},onTouchViewLoad:function(){if(this.store.getCount()<1){this.onTouchViewEmptyResults();return;}this.clearTouchView();
+var A=this.getRawValue();var B=(this.multiple)?Roo.bootstrap.ComboBox.listItemCheckbox:Roo.bootstrap.ComboBox.listItemRadio;this.tickItems=[];this.store.data.each(function(d,G){var H=this.touchViewListGroup.createChild(B);if(typeof(d.data.cls)!='undefined'&&d.data.cls.length){H.addClass(d.data.cls);
+}if(this.displayField&&typeof(d.data[this.displayField])!='undefined'){var I={data:d.data,html:d.data[this.displayField]};if(this.fireEvent('touchviewdisplay',this,I)!==false){H.select('.roo-combobox-list-group-item-value',true).first().dom.innerHTML=I.html;
+}}H.removeClass('selected');if(!this.multiple&&this.valueField&&typeof(d.data[this.valueField])!='undefined'&&d.data[this.valueField]==this.getValue()){H.select('.roo-combobox-list-group-item-box > input',true).first().attr('checked',true);H.addClass('selected');
+}if(this.multiple&&this.valueField&&typeof(d.data[this.valueField])!='undefined'&&this.getValue().indexOf(d.data[this.valueField])!=-1){H.select('.roo-combobox-list-group-item-box > input',true).first().attr('checked',true);this.tickItems.push(d.data);}H.on('click',this.onTouchViewClick,this,{row:H,rowIndex:G}
+);},this);var C=this.touchViewListGroup.select('.list-group-item > .roo-combobox-list-group-item-box > input:checked',true).first();var D=Roo.lib.Dom.getViewHeight()-this.touchViewFooterEl.getHeight()+this.touchViewBodyEl.getPadding('tb');if(this.modalTitle.length){D=D-this.touchViewHeaderEl.getHeight();
+}var E=this.touchViewListGroup.getHeight()+this.touchViewBodyEl.getPadding('tb')*2;if(this.mobile_restrict_height&&E<D){this.touchViewBodyEl.setHeight(E);}var F=this;if(C&&E>D){(function(){C.findParent('li').scrollIntoView(F.touchViewListGroup.dom);}).defer(500);
+}},onTouchViewLoadException:function(){this.hideTouchView();},onTouchViewEmptyResults:function(){this.clearTouchView();this.touchViewListGroup.createChild(Roo.bootstrap.ComboBox.emptyResult);this.touchViewListGroup.select('.roo-combobox-touch-view-empty-result',true).first().dom.innerHTML=this.emptyResultText;
 },clearTouchView:function(){this.touchViewListGroup.dom.innerHTML='';},onTouchViewClick:function(e,el,o){e.preventDefault();var A=o.row;var B=o.rowIndex;var r=this.store.getAt(B);if(this.fireEvent('beforeselect',this,r,B)!==false){if(!this.multiple){Roo.each(this.touchViewListGroup.select('.list-group-item > .roo-combobox-list-group-item-box > input:checked',true).elements,function(c){c.dom.removeAttribute('checked');
 },this);A.select('.roo-combobox-list-group-item-box > input',true).first().attr('checked',true);this.setFromData(r.data);var C=this.closeTriggerEl();if(C){C.show();}this.hideTouchView();this.fireEvent('select',this,r,B);return;}if(this.valueField&&typeof(r.data[this.valueField])!='undefined'&&this.getValue().indexOf(r.data[this.valueField])!=-1){A.select('.roo-combobox-list-group-item-box > input',true).first().dom.removeAttribute('checked');
 this.tickItems.splice(this.tickItems.indexOf(r.data),1);return;}A.select('.roo-combobox-list-group-item-box > input',true).first().attr('checked',true);this.addItem(r.data);this.tickItems.push(r.data);}},getAutoCreateNativeIOS:function(){var A={cls:'form-group'}
@@ -842,8 +842,9 @@ var xy=this.alignEl.getAnchorXY('tl',false);xy[0]-=10;xy[1]+=5;this.arrowEl.setX
 if(!B||C.equals(D)||C[1]==D[1]){this.el.setXY(D);var xy=this.alignEl.getAnchorXY('t',false);xy[1]-=10;this.arrowEl.setXY(xy);return true;}return this.updatePosition('bottom',false);case 'bottom':var C=this.el.getAlignToXY(this.alignEl,'t-b',[0,10]);var D=this.el.getAlignToXY(this.alignEl,'t-b?',[0,10]);
 if(!B||C.equals(D)||C[1]==D[1]){this.el.setXY(D);var xy=this.alignEl.getAnchorXY('b',false);xy[1]+=2;this.arrowEl.setXY(xy);return true;}return this.updatePosition('top',false);}return false;},hide:function(){this.el.setXY([0,0]);this.el.removeClass('in');
 this.el.hide();this.hoverState=null;this.maskEl.hide();this.fireEvent('hide',this);}});Roo.apply(Roo.bootstrap.Popover,{alignment:{'left':['r-l',[-10,0],'left bs-popover-left'],'right':['l-br',[10,0],'right bs-popover-right'],'bottom':['t-b',[0,10],'top bs-popover-top'],'top':['b-t',[0,-10],'bottom bs-popover-bottom']}
-,zIndex:20001,clickHander:false,onMouseDown:function(e){if(!e.getTarget(".roo-popover")){this.hideAll();}},popups:[],register:function(A){if(!Roo.bootstrap.Popover.clickHandler){Roo.bootstrap.Popover.clickHandler=Roo.get(document).on("mousedown",Roo.bootstrap.Popover.onMouseDown,Roo.bootstrap.Popover);
-}this.hideAll();this.popups.push(A);},hideAll:function(){this.popups.forEach(function(p){p.hide();});}});
+,zIndex:20001,clickHander:false,onMouseDown:function(e){if(this.popups.length&&!e.getTarget(".roo-popover")){this.hideAll();}},popups:[],register:function(A){if(!Roo.bootstrap.Popover.clickHandler){Roo.bootstrap.Popover.clickHandler=Roo.get(document).on("mousedown",Roo.bootstrap.Popover.onMouseDown,Roo.bootstrap.Popover);
+}A.on('show',Roo.bootstrap.Popover.onShow,A);A.on('hide',Roo.bootstrap.Popover.onHide,A);this.hideAll();},hideAll:function(){this.popups.forEach(function(p){p.hide();});},onShow:function(){Roo.bootstrap.Popover.popups.push(this);},onHide:function(){Roo.bootstrap.Popover.popups.remove(this);
+}});
 // Roo/bootstrap/PopoverNav.js
 Roo.bootstrap.PopoverNav=function(A){Roo.bootstrap.PopoverNav.superclass.constructor.call(this,A);};Roo.extend(Roo.bootstrap.PopoverNav,Roo.bootstrap.NavSimplebar,{container_method:'getPopoverHeader'});
 // Roo/bootstrap/Progress.js
@@ -917,8 +918,8 @@ F=this.moveYear(this.viewDate,B);}else if(e.shiftKey){E=this.moveMonth(this.date
 this.hidePopup();break;case 16:case 17:case 18:break;default:this.hidePopup();}},onClick:function(e){e.stopPropagation();e.preventDefault();var A=e.getTarget();if(A.nodeName.toLowerCase()==='i'){A=Roo.get(A).dom.parentNode;}var B=A.nodeName;var C=A.className;
 var D=A.innerHTML;switch(B.toLowerCase()){case 'th':switch(C){case 'switch':this.showMode(1);break;case 'prev':case 'next':var E=Roo.bootstrap.DateField.modes[this.viewMode].navStep*(C=='prev'?-1:1);switch(this.viewMode){case 0:this.viewDate=this.moveMonth(this.viewDate,E);
 break;case 1:case 2:this.viewDate=this.moveYear(this.viewDate,E);break;}this.fill();break;case 'today':var F=new Date();this.date=this.UTCDate(F.getFullYear(),F.getMonth(),F.getDate(),0,0,0);this.setValue(this.formatDate(this.date));this.hidePopup();break;
-}break;case 'span':if(C.indexOf('disabled')<0){this.viewDate.setUTCDate(1);if(C.indexOf('month')>-1){this.viewDate.setUTCMonth(Roo.bootstrap.DateField.dates[this.language].monthsShort.indexOf(D));}else{var G=parseInt(D,10)||0;this.viewDate.setUTCFullYear(G);
-}if(this.singleMode){this.setValue(this.formatDate(this.viewDate));this.hidePopup();return;}this.showMode(-1);this.fill();}break;case 'td':if(C.indexOf('day')>-1&&C.indexOf('disabled')<0){var H=parseInt(D,10)||1;var G=(this.viewDate||new Date()).getUTCFullYear(),I=(this.viewDate||new Date()).getUTCMonth();
+}break;case 'span':if(C.indexOf('disabled')<0){if(!this.viewDate){this.viewDate=new Date();}this.viewDate.setUTCDate(1);if(C.indexOf('month')>-1){this.viewDate.setUTCMonth(Roo.bootstrap.DateField.dates[this.language].monthsShort.indexOf(D));}else{var G=parseInt(D,10)||0;
+this.viewDate.setUTCFullYear(G);}if(this.singleMode){this.setValue(this.formatDate(this.viewDate));this.hidePopup();return;}this.showMode(-1);this.fill();}break;case 'td':if(C.indexOf('day')>-1&&C.indexOf('disabled')<0){var H=parseInt(D,10)||1;var G=(this.viewDate||new Date()).getUTCFullYear(),I=(this.viewDate||new Date()).getUTCMonth();
 if(C.indexOf('old')>-1){if(I===0){I=11;G-=1;}else{I-=1;}}else if(C.indexOf('new')>-1){if(I==11){I=0;G+=1;}else{I+=1;}}this.date=this.UTCDate(G,I,H,0,0,0,0);this.viewDate=this.UTCDate(G,I,Math.min(28,H),0,0,0,0);this.setValue(this.formatDate(this.date));this.hidePopup();
 }break;}},setStartDate:function(A){this.startDate=A||-Infinity;if(this.startDate!==-Infinity){this.startDate=this.parseDate(this.startDate);}this.update();this.updateNavArrows();},setEndDate:function(A){this.endDate=A||Infinity;if(this.endDate!==Infinity){this.endDate=this.parseDate(this.endDate);
 }this.update();this.updateNavArrows();},setDaysOfWeekDisabled:function(A){this.daysOfWeekDisabled=A||[];if(typeof(this.daysOfWeekDisabled)!=='object'){this.daysOfWeekDisabled=this.daysOfWeekDisabled.split(/,\s*/);}this.daysOfWeekDisabled=this.daysOfWeekDisabled.map(function(d){return parseInt(d,10);
@@ -1262,9 +1263,9 @@ B.addressLine2="";return B;},setZoomLevel:function(A){this.gMapContext.map.setZo
 // Roo/bootstrap/Alert.js
 Roo.bootstrap.Alert=function(A){Roo.bootstrap.Alert.superclass.constructor.call(this,A);};Roo.extend(Roo.bootstrap.Alert,Roo.bootstrap.Component,{title:'',html:'',weight:false,fa:false,faicon:false,close:false,getAutoCreate:function(){var A={tag:'div',cls:'alert',cn:[{tag:'button',type:"button",cls:"close",html:'×',style:this.close?'':'display:none'}
 ,{tag:'i',cls:'roo-alert-icon'},{tag:'b',cls:'roo-alert-title',html:this.title},{tag:'span',cls:'roo-alert-text',html:this.html}]};if(this.faicon){A.cn[0].cls+=' fa '+this.faicon;}if(this.fa){A.cn[0].cls+=' fa '+this.fa;}if(this.weight){A.cls+=' alert-'+this.weight;
-}return A;},initEvents:function(){this.el.setVisibilityMode(Roo.Element.DISPLAY);this.titleEl=this.el.select('.roo-alert-title',true).first();this.iconEl=this.el.select('.roo-alert-icon',true).first();if(this.seconds>0){this.hide.defer(this.seconds,this);
-}},setTitle:function(A){this.titleEl.dom.innerHTML=A;},setText:function(A){this.titleEl.dom.innerHTML=A;},setWeight:function(A){if(this.weight){this.el.removeClass('alert-'+this.weight);}this.weight=A;this.el.addClass('alert-'+this.weight);},setIcon:function(A){if(this.faicon){this.alertEl.removeClass(['fa','fa-'+this.faicon]);
-}this.faicon=A;this.alertEl.addClass(['fa','fa-'+this.faicon]);},hide:function(){this.el.hide();},show:function(){this.el.show();}});
+}return A;},initEvents:function(){this.el.setVisibilityMode(Roo.Element.DISPLAY);this.titleEl=this.el.select('.roo-alert-title',true).first();this.iconEl=this.el.select('.roo-alert-icon',true).first();this.htmlEl=this.el.select('.roo-alert-text',true).first();
+if(this.seconds>0){this.hide.defer(this.seconds,this);}},setTitle:function(A){this.titleEl.dom.innerHTML=A;},setHtml:function(A){this.htmlEl.dom.innerHTML=A;},setWeight:function(A){if(this.weight){this.el.removeClass('alert-'+this.weight);}this.weight=A;this.el.addClass('alert-'+this.weight);
+},setIcon:function(A){if(this.faicon){this.alertEl.removeClass(['fa','fa-'+this.faicon]);}this.faicon=A;this.alertEl.addClass(['fa','fa-'+this.faicon]);},hide:function(){this.el.hide();},show:function(){this.el.show();}});
 // Roo/bootstrap/UploadCropbox.js
 Roo.bootstrap.UploadCropbox=function(A){Roo.bootstrap.UploadCropbox.superclass.constructor.call(this,A);this.addEvents({"beforeselectfile":true,"initial":true,"crop":true,"prepare":true,"exception":true,"beforeloadcanvas":true,"trash":true,"download":true,"footerbuttonclick":true,"resize":true,"rotate":true,"inspect":true,"upload":true,"arrange":true}
 );this.buttons=this.buttons||Roo.bootstrap.UploadCropbox.footer.STANDARD;};Roo.extend(Roo.bootstrap.UploadCropbox,Roo.bootstrap.Component,{emptyText:'Click to upload image',rotateNotify:'Image is too small to rotate',errorTimeout:3000,scale:0,baseScale:1,rotate:0,dragable:false,pinching:false,mouseX:0,mouseY:0,cropData:false,minWidth:300,minHeight:300,file:false,exif:{}