Fix #6874 - Grid column resize
[roojs1] / roojs-bootstrap.js
index 6fadcc4..562cd71 100644 (file)
@@ -305,6 +305,39 @@ Roo.bootstrap.PaginationItem=function(A){Roo.bootstrap.PaginationItem.superclass
 // Roo/bootstrap/Slider.js
 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/SplitDragZone.js
+Roo.grid.SplitDragZone=function(A,hd,B){this.grid=A;this.view=A.getView();this.proxy=this.view.resizeProxy;Roo.grid.SplitDragZone.superclass.constructor.call(this,hd,"gridSplitters"+this.grid.getGridEl().id,{dragElId:Roo.id(this.proxy.dom),resizeFrame:false}
+);this.setHandleElId(Roo.id(hd));if(B!==false){this.setOuterHandleElId(Roo.id(B));}this.scroll=false;};Roo.extend(Roo.grid.SplitDragZone,Roo.dd.DDProxy,{fly:Roo.Element.fly,b4StartDrag:function(x,y){this.view.headersDisabled=true;var h=this.view.mainWrap?this.view.mainWrap.getHeight():(this.view.headEl.getHeight()+this.view.bodyEl.getHeight());
+this.proxy.setHeight(h);var w=this.cm.getColumnWidth(this.cellIndex);if(!this.view.mainWrap){w=this.view.getHeaderIndex(this.cellIndex).getWidth();}var A=Math.max(w-this.grid.minColumnWidth,0);this.resetConstraints();this.setXConstraint(A,1000);this.setYConstraint(0,0);
+this.minX=x-A;this.maxX=x+1000;this.startPos=x;if(!this.view.mainWrap){this.getDragEl().style.display='block';}Roo.dd.DDProxy.prototype.b4StartDrag.call(this,x,y);},handleMouseDown:function(e){ev=Roo.EventObject.setEvent(e);var t=this.fly(ev.getTarget());
+if(t.hasClass("x-grid-split")){this.cellIndex=this.view.getCellIndex(t.dom);this.split=t.dom;this.cm=this.grid.colModel;if(this.cm.isResizable(this.cellIndex)&&!this.cm.isFixed(this.cellIndex)){Roo.grid.SplitDragZone.superclass.handleMouseDown.apply(this,arguments);
+}}},endDrag:function(e){this.view.headersDisabled=false;var A=Math.max(this.minX,Roo.lib.Event.getPageX(e));var B=A-this.startPos;var w=this.cm.getColumnWidth(this.cellIndex);if(!this.view.mainWrap){w=0;}this.view.onColumnSplitterMoved(this.cellIndex,w+B);
+},autoOffset:function(){this.setDelta(0,0);}});
+// Roo/grid/AbstractSelectionModel.js
+Roo.grid.AbstractSelectionModel=function(){this.locked=false;Roo.grid.AbstractSelectionModel.superclass.constructor.call(this);};Roo.extend(Roo.grid.AbstractSelectionModel,Roo.util.Observable,{init:function(A){this.grid=A;this.initEvents();},lock:function(){this.locked=true;
+},unlock:function(){this.locked=false;},isLocked:function(){return this.locked;}});
+// Roo/grid/RowSelectionModel.js
+Roo.grid.RowSelectionModel=function(A){Roo.apply(this,A);this.selections=new Roo.util.MixedCollection(false,function(o){return o.id;});this.last=false;this.lastActive=false;this.addEvents({"selectionchange":true,"afterselectionchange":true,"beforerowselect":true,"rowselect":true,"rowdeselect":true}
+);Roo.grid.RowSelectionModel.superclass.constructor.call(this);this.locked=false;};Roo.extend(Roo.grid.RowSelectionModel,Roo.grid.AbstractSelectionModel,{singleSelect:false,initEvents:function(){if(!this.grid.enableDragDrop&&!this.grid.enableDrag){this.grid.on("mousedown",this.handleMouseDown,this);
+}else{this.grid.on("rowclick",this.handleDragableRowClick,this);}var A=this.grid.view?this.grid.view:this.grid;this.rowNav=new Roo.KeyNav(this.grid.getGridEl(),{"up":function(e){if(!e.shiftKey){this.selectPrevious(e.shiftKey);}else if(this.last!==false&&this.lastActive!==false){var B=this.last;
+this.selectRange(this.last,this.lastActive-1);A.focusRow(this.lastActive);if(B!==false){this.last=B;}}else{this.selectFirstRow();}this.fireEvent("afterselectionchange",this);},"down":function(e){if(!e.shiftKey){this.selectNext(e.shiftKey);}else if(this.last!==false&&this.lastActive!==false){var B=this.last;
+this.selectRange(this.last,this.lastActive+1);A.focusRow(this.lastActive);if(B!==false){this.last=B;}}else{this.selectFirstRow();}this.fireEvent("afterselectionchange",this);},scope:this});A.on("refresh",this.onRefresh,this);A.on("rowupdated",this.onRowUpdated,this);
+A.on("rowremoved",this.onRemove,this);},onRefresh:function(){var ds=this.grid.ds,i,v=this.grid.view;var s=this.selections;s.each(function(r){if((i=ds.indexOfId(r.id))!=-1){v.onRowSelect(i);s.add(ds.getAt(i));}else{s.remove(r);}});},onRemove:function(v,A,r){this.selections.remove(r);
+},onRowUpdated:function(v,A,r){if(this.isSelected(r)){v.onRowSelect(A);}},selectRecords:function(A,B){if(!B){this.clearSelections();}var ds=this.grid.ds;for(var i=0,C=A.length;i<C;i++){this.selectRow(ds.indexOf(A[i]),true);}},getCount:function(){return this.selections.length;
+},selectFirstRow:function(){this.selectRow(0);},selectLastRow:function(A){this.selectRow(this.grid.ds.getCount()-1,A);},selectNext:function(A){if(this.last!==false&&(this.last+1)<this.grid.ds.getCount()){this.selectRow(this.last+1,A);var B=this.grid.view?this.grid.view:this.grid;
+B.focusRow(this.last);}},selectPrevious:function(A){if(this.last){this.selectRow(this.last-1,A);var B=this.grid.view?this.grid.view:this.grid;B.focusRow(this.last);}},getSelections:function(){return [].concat(this.selections.items);},getSelected:function(){return this.selections.itemAt(0);
+},clearSelections:function(A){if(this.locked){return;}if(A!==true){var ds=this.grid.ds;var s=this.selections;s.each(function(r){this.deselectRow(ds.indexOfId(r.id));},this);s.clear();}else{this.selections.clear();}this.last=false;},selectAll:function(){if(this.locked){return;
+}this.selections.clear();for(var i=0,A=this.grid.ds.getCount();i<A;i++){this.selectRow(i,true);}},hasSelection:function(){return this.selections.length>0;},isSelected:function(A){var r=typeof A=="number"?this.grid.ds.getAt(A):A;return (r&&this.selections.key(r.id)?true:false);
+},isIdSelected:function(id){return (this.selections.key(id)?true:false);},handleMouseDown:function(e,t){var A=this.grid.view?this.grid.view:this.grid;var B;if(this.isLocked()||(B=A.findRowIndex(t))===false){return;};if(e.shiftKey&&this.last!==false){var C=this.last;
+this.selectRange(C,B,e.ctrlKey);this.last=C;A.focusRow(B);}else{var D=this.isSelected(B);if(e.button!==0&&D){A.focusRow(B);}else if(e.ctrlKey&&D){this.deselectRow(B);}else if(!D){this.selectRow(B,e.button===0&&(e.ctrlKey||e.shiftKey));A.focusRow(B);}}this.fireEvent("afterselectionchange",this);
+},handleDragableRowClick:function(A,B,e){if(e.button===0&&!e.shiftKey&&!e.ctrlKey){this.selectRow(B,false);var C=this.grid.view?this.grid.view:this.grid;C.focusRow(B);this.fireEvent("afterselectionchange",this);}},selectRows:function(A,B){if(!B){this.clearSelections();
+}for(var i=0,C=A.length;i<C;i++){this.selectRow(A[i],true);}},selectRange:function(A,B,C){if(this.locked){return;}if(!C){this.clearSelections();}if(A<=B){for(var i=A;i<=B;i++){this.selectRow(i,true);}}else{for(var i=A;i>=B;i--){this.selectRow(i,true);}}},deselectRange:function(A,B,C){if(this.locked){return;
+}for(var i=A;i<=B;i++){this.deselectRow(i,C);}},selectRow:function(A,B,C){if(this.locked||(A<0||A>=this.grid.ds.getCount())){return;}if(this.fireEvent("beforerowselect",this,A,B)!==false){if(!B||this.singleSelect){this.clearSelections();}var r=this.grid.ds.getAt(A);
+this.selections.add(r);this.last=this.lastActive=A;if(!C){var D=this.grid.view?this.grid.view:this.grid;D.onRowSelect(A);}this.fireEvent("rowselect",this,A,r);this.fireEvent("selectionchange",this);}},deselectRow:function(A,B){if(this.locked){return;}if(this.last==A){this.last=false;
+}if(this.lastActive==A){this.lastActive=false;}var r=this.grid.ds.getAt(A);this.selections.remove(r);if(!B){var C=this.grid.view?this.grid.view:this.grid;C.onRowDeselect(A);}this.fireEvent("rowdeselect",this,A);this.fireEvent("selectionchange",this);},restoreLast:function(){if(this._last){this.last=this._last;
+}},acceptsNav:function(A,B,cm){return !cm.isHidden(B)&&cm.isCellEditable(B,A);},onEditorKey:function(A,e){var k=e.getKey(),B,g=this.grid,ed=g.activeEditor;if(k==e.TAB){e.stopEvent();ed.completeEdit();if(e.shiftKey){B=g.walkCells(ed.row,ed.col-1,-1,this.acceptsNav,this);
+}else{B=g.walkCells(ed.row,ed.col+1,1,this.acceptsNav,this);}}else if(k==e.ENTER&&!e.ctrlKey){e.stopEvent();ed.completeEdit();if(e.shiftKey){B=g.walkCells(ed.row-1,ed.col,-1,this.acceptsNav,this);}else{B=g.walkCells(ed.row+1,ed.col,1,this.acceptsNav,this);
+}}else if(k==e.ESC){ed.cancelEdit();}if(B){g.startEditing(B[0],B[1]);}}});
 // Roo/grid/ColumnModel.js
 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);
@@ -313,11 +346,11 @@ return B>-1?this.config[B]:false;},getIndexById:function(id){for(var i=0,A=this.
 }this.config[A].locked=B;if(!C){this.fireEvent("columnlockchange",this,A,B);}},getTotalLockedWidth:function(){var A=0;for(var i=0;i<this.config.length;i++){if(this.isLocked(i)&&!this.isHidden(i)){this.totalWidth+=this.getColumnWidth(i);}}return A;},getLockedCount:function(){for(var i=0,A=this.config.length;
 i<A;i++){if(!this.isLocked(i)){return i;}}return this.config.length;},getColumnCount:function(A){if(A===true){var c=0;for(var i=0,B=this.config.length;i<B;i++){if(!this.isHidden(i)){c++;}}return c;}return this.config.length;},getColumnsBy:function(fn,A){var r=[];
 for(var i=0,B=this.config.length;i<B;i++){var c=this.config[i];if(fn.call(A||this,c,i)===true){r[r.length]=c;}}return r;},isSortable:function(A){if(typeof this.config[A].sortable=="undefined"){return this.defaultSortable;}return this.config[A].sortable;},getRenderer:function(A){if(!this.config[A].renderer){return Roo.grid.ColumnModel.defaultRenderer;
-}return this.config[A].renderer;},setRenderer:function(A,fn){this.config[A].renderer=fn;},getColumnWidth:function(A){return this.config[A].width*1||this.defaultWidth;},setColumnWidth:function(A,B,C){this.config[A].width=B;this.totalWidth=null;if(!C){this.fireEvent("widthchange",this,A,B);
-}},getTotalWidth:function(A){if(!this.totalWidth){this.totalWidth=0;for(var i=0,B=this.config.length;i<B;i++){if(A||!this.isHidden(i)){this.totalWidth+=this.getColumnWidth(i);}}}return this.totalWidth;},getColumnHeader:function(A){return this.config[A].header;
-},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;
+}return this.config[A].renderer;},setRenderer:function(A,fn){this.config[A].renderer=fn;},getColumnWidth:function(A,B){var C=this.config[A];if(typeof(B)=='undefined'){return C.width*1||this.defaultWidth;}if(B===false){return C.width||false;}var D=['xl','lg','md','sm','xs'];
+for(var i=D.indexOf(B);i<D.length;i++){if(typeof(C[D[i]])=='undefined'){continue;}return C[D[i]];}return 1;},setColumnWidth:function(A,B,C){this.config[A].width=B;this.totalWidth=null;if(!C){this.fireEvent("widthchange",this,A,B);}},getTotalWidth:function(A){if(!this.totalWidth){this.totalWidth=0;
+for(var i=0,B=this.config.length;i<B;i++){if(A||!this.isHidden(i)){this.totalWidth+=this.getColumnWidth(i);}}}return this.totalWidth;},getColumnHeader:function(A){return this.config[A].header;},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;},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;
@@ -329,59 +362,68 @@ um.showLoadIndicator=false;um.on('beforeupdate',this.onBeforeLoad,this);um.on('u
 this.store.un('loadexception',this.onLoadException,this);}else{var um=this.el.getUpdateManager();um.un('beforeupdate',this.onBeforeLoad,this);um.un('update',this.onLoad,this);um.un('failure',this.onLoad,this);}}};
 // Roo/bootstrap/Table.js
 Roo.bootstrap.Table=function(A){Roo.bootstrap.Table.superclass.constructor.call(this,A);this.rowSelection=(typeof(A.rowSelection)!='undefined')?A.rowSelection:this.rowSelection;this.cellSelection=(typeof(A.cellSelection)!='undefined')?A.cellSelection:this.cellSelection;
-this.headerShow=(typeof(A.thead)!='undefined')?A.thead:this.headerShow;this.footerShow=(typeof(A.tfoot)!='undefined')?A.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.headerShow=(typeof(A.thead)!='undefined')?A.thead:this.headerShow;this.footerShow=(typeof(A.tfoot)!='undefined')?A.tfoot:this.footerShow;this.view=this;this.sm=this.sm||{xtype:'RowSelectionModel'};if(this.sm){this.sm.grid=this;this.selModel=Roo.factory(this.sm,Roo.grid);
 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;this.cm.xmodule=this.xmodule||false;}if(this.store){this.store=Roo.factory(this.store,Roo.data);
-this.ds=this.store;this.ds.xmodule=this.xmodule||false;}if(this.footer&&this.store){this.footer.dataSource=this.ds;this.footer=Roo.factory(this.footer);}this.addEvents({"cellclick":true,"celldblclick":true,"rowclick":true,"rowdblclick":true,"mouseover":true,"mouseout":true,'rowclass':true,'rowsrendered':true,"contextmenu":true,"rowcontextmenu":true,"cellcontextmenu":true,"headercontextmenu":true}
-);};Roo.extend(Roo.bootstrap.Table,Roo.bootstrap.Component,{cls:false,align:false,bgcolor:false,border:false,cellpadding:false,cellspacing:false,frame:false,rules:false,sortable:false,summary:false,width:false,striped:false,scrollBody:false,bordered:false,hover:false,condensed:false,responsive:false,sm:false,cm:false,store:false,loadMask:false,footerShow:true,headerShow:true,rowSelection:false,cellSelection:false,layout:false,mainBody:false,mainHead:false,container:false,lazyLoad:false,CSS:Roo.util.CSS,auto_hide_footer:false,getAutoCreate:function(){var A=Roo.apply({}
+this.ds=this.store;this.ds.xmodule=this.xmodule||false;}if(this.footer&&this.store){this.footer.dataSource=this.ds;this.footer=Roo.factory(this.footer);}this.addEvents({"cellclick":true,"celldblclick":true,"rowclick":true,"rowdblclick":true,"mouseover":true,"mouseout":true,'rowclass':true,'rowsrendered':true,"contextmenu":true,"rowcontextmenu":true,"cellcontextmenu":true,"headercontextmenu":true,"mousedown":true}
+);};Roo.extend(Roo.bootstrap.Table,Roo.bootstrap.Component,{cls:false,striped:false,scrollBody:false,bordered:false,hover:false,condensed:false,responsive:false,sm:false,cm:false,store:false,loadMask:false,footerShow:true,headerShow:true,enableColumnResize:true,rowSelection:false,cellSelection:false,layout:false,minColumnWidth:50,bodyEl:false,headEl:false,resizeProxy:false,container:false,lazyLoad:false,CSS:Roo.util.CSS,auto_hide_footer:false,view:false,getAutoCreate:function(){var A=Roo.apply({}
 ,Roo.bootstrap.Table.superclass.getAutoCreate.call(this));A={tag:'table',cls:'table',cn:[]};if(this.scrollBody){A.cls+=' table-body-fixed';}if(this.striped){A.cls+=' table-striped';}if(this.hover){A.cls+=' table-hover';}if(this.bordered){A.cls+=' table-bordered';
-}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();
-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;
-}if(B.findParent('thead',false,true)){if(e.getTarget().nodeName.toLowerCase()!='th'){B=Roo.get(t).findParent('th',false,true);if(!B){Roo.log("failed to find th in thead?");Roo.log(e.getTarget());return;}}var C=B.dom.cellIndex;var D=A=='touchstart'?'click':A;
-this.fireEvent("header"+D,this,C,e);return;}if(e.getTarget().nodeName.toLowerCase()!='td'){B=Roo.get(t).findParent('td',false,true);if(!B){Roo.log("failed to find th in tbody?");Roo.log(e.getTarget());return;}}var E=B.findParent('tr',false,true);var C=B.dom.cellIndex;
-var F=E.dom.rowIndex-1;if(E!==false){this.fireEvent("row"+A,this,F,e);if(B!==false){this.fireEvent("cell"+A,this,F,C,e);}}},onMouseover:function(e,el){var A=Roo.get(el);if(!A){return;}if(e.getTarget().nodeName.toLowerCase()!='td'){A=A.findParent('td',false,true);
-}var B=A.findParent('tr',false,true);var C=A.dom.cellIndex;var D=B.dom.rowIndex-1;this.fireEvent('mouseover',this,A,D,C,e);},onMouseout:function(e,el){var A=Roo.get(el);if(!A){return;}if(e.getTarget().nodeName.toLowerCase()!='td'){A=A.findParent('td',false,true);
-}var B=A.findParent('tr',false,true);var C=A.dom.cellIndex;var D=B.dom.rowIndex-1;this.fireEvent('mouseout',this,A,D,C,e);},onClick: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);this.fireEvent('cellclick',this,A,D,C,e);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('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(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);
-}var bt=this.mainBody.dom;var D=this.el.select('tbody > tr',true).elements;if(typeof(D[B])!='undefined'){bt.removeChild(D[B].dom);}if(C!==true){this.fireEvent("rowremoved",this,B,A);}},onAdd:function(ds,A,B){var bt=this.mainBody.dom;for(var i=0;i<A.length;
-i++){this.insertRow(this.store,B+i,false);return;}},refreshRow:function(A){var ds=this.store,B;if(typeof A=='number'){B=A;A=ds.getAt(B);}else{B=ds.indexOf(A);if(B<0){return;}}this.insertRow(ds,B,true);this.autoSize();this.onRemove(ds,A,B+1,true);this.autoSize();
-this.fireEvent("rowupdated",this,B,A);},insertRow:function(dm,A,B){if(!B){this.fireEvent("beforerowsinserted",this,A);}var C=this.renderRow(this.cm,this.store,A);var e=this.mainBody.createChild(C,this.getRowDom(A));var D=this;if(C.cellObjects.length){Roo.each(C.cellObjects,function(r){D.renderCellObject(r);
-})}if(!B){this.fireEvent("rowsinserted",this,A);}},getRowDom:function(A){var B=this.el.select('tbody > tr',true).elements;return (typeof(B[A])=='undefined')?false:B[A];},renderRow:function(cm,ds,A){var d=ds.getAt(A);var B={tag:'tr',cls:'x-row-'+A,cn:[]};var C=[];
-for(var i=0,D=cm.getColumnCount();i<D;i++){var E=cm.config[i];var F=cm.getRenderer(i);var G='';var id=false;if(typeof(F)!=='undefined'){G=F(d.data[cm.getDataIndex(i)],false,d);}if(typeof(G)==='object'){id=Roo.id();C.push({container:id,cfg:G})}var H={record:d,rowIndex:A,colIndex:i,rowClass:''}
-;this.fireEvent('rowclass',this,H);var td={tag:'td',cls:H.rowClass+' x-col-'+i,style:'',html:(typeof(G)==='object')?'':G};if(id){td.id=id;}if(typeof(E.colspan)!='undefined'){td.colspan=E.colspan;}if(typeof(E.hidden)!='undefined'&&E.hidden){td.style+=' display:none;';
-}if(typeof(E.align)!='undefined'&&E.align.length){td.style+=' text-align:'+E.align+';';}if(typeof(E.valign)!='undefined'&&E.valign.length){td.style+=' vertical-align:'+E.valign+';';}if(typeof(E.width)!='undefined'){td.style+=' width:'+E.width+'px;';}if(typeof(E.cursor)!='undefined'){td.style+=' cursor:'+E.cursor+';';
-}if(typeof(E.cls)!='undefined'){td.cls=(typeof(td.cls)=='undefined')?E.cls:(td.cls+' '+E.cls);}['xs','sm','md','lg'].map(function(I){if(typeof(E[I])=='undefined'){return;}if(!E[I]){td.cls+=' hidden-'+I+' hidden'+I+'-down';return;}td.cls+=' col-'+I+'-'+E[I]+(I=='xs'?(' col-'+E[I]):'');
-});B.cn.push(td);}B.cellObjects=C;return B;},onBeforeLoad:function(){},clear:function(){this.el.select('tbody',true).first().dom.innerHTML='';},setRowVisibility:function(A,B){var bt=this.mainBody.dom;var C=this.el.select('tbody > tr',true).elements;if(typeof(C[A])=='undefined'){return;
-}C[A].dom.style.display=B?'':'none';},getSelectionModel:function(){if(!this.selModel){this.selModel=new Roo.bootstrap.Table.RowSelectionModel({grid:this});}return this.selModel;},renderCellObject:function(r){var A=this;r.cfg.parentId=(typeof(r.container)=='string')?r.container:r.container.id;
-var t=r.cfg.render(r.container);if(r.cfg.cn){Roo.each(r.cfg.cn,function(c){var B={container:t.getChildContainer(),cfg:c};A.renderCellObject(B);})}},getRowIndex:function(A){var B=-1;Roo.each(this.el.select('tbody > tr',true).elements,function(el,C){if(el!=A){return;
-}B=C;});return B;},getGridEl:function(){return this.el;},autoSize:function(){var A=Roo.get(this.el.dom);var B=this.getGridEl().select('thead',true).first();var C=this.getGridEl().select('tbody',true).first();var D=this.getGridEl().select('tfoot',true).first();
-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);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];
-}}});
+}if(this.condensed){A.cls+=' table-condensed';}if(this.responsive){A.cls+=' table-responsive';}if(this.cls){A.cls+=' '+this.cls;}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.bodyEl=this.el.select('tbody',true).first();this.headEl=this.el.select('thead',true).first();this.mainFoot=this.el.select('tfoot',true).first();Roo.each(this.el.select('thead th.sortable',true).elements,function(e){e.on('click',this.sort,this);},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.cm.on("headerchange",this.onHeaderChange,this);this.cm.on("hiddenchange",this.onHiddenChange,this,arguments);this.bodyEl.on("click",this.onClick,this);this.bodyEl.on("dblclick",this.onDblClick,this);this.bodyEl.on('scroll',this.onBodyScroll,this);this.relayEvents(this.bodyEl,["mousedown","mouseup","mouseover","mouseout","keypress"]);
+this.resizeProxy=Roo.get(document.body).createChild({cls:"x-grid-resize-proxy",html:'&#160;'});if(this.headEl&&this.enableColumnResize!==false&&Roo.grid.SplitDragZone){new Roo.grid.SplitDragZone(this,this.headEl.dom,false);}this.initCSS();},getView:function(){return this;
+},initCSS:function(){var cm=this.cm,A=[];this.CSS.removeStyleSheet(this.id+'-cssrules');var B=this.headEl?this.headEl.dom.clientHeight:0;var sz=Roo.getGridSize();var C=0;var D=-1;var E=[];var F=0;for(var i=0,G=cm.getColumnCount();i<G;i++){var w=cm.getColumnWidth(i,false);
+if(cm.isHidden(i)){E.push({rel:false,abs:0});continue;}if(w!==false){E.push({rel:false,abs:w});F+=w;D=i;continue;}var w=cm.getColumnWidth(i,sz);if(w>0){D=i}C+=w;E.push({rel:w,abs:false});}var H=this.bodyEl.dom.clientWidth-F;var I=Math.floor(H/C);var J=H-(I*C);
+var K,L,M=0,N,O;for(var i=0,G=cm.getColumnCount();i<G;i++){K='display:none;';O='';L='width:0px;';N='';if(!cm.isHidden(i)){K='';var w=E[i].rel==false?E[i].abs:(E[i].rel*I);if(w===0){K='display:none;';}if(i==D){w+=J;}M+=w;O="left:"+(M-4)+"px;";L="width:"+w+"px;";
+}A.push('#',this.id,' .x-col-',i," {",cm.config[i].css,L,K,"}\n");if(this.headEl){if(i==D){N='display:none;';}A.push('#',this.id,' .x-hcol-',i," { ",L,K," }\n",'#',this.id,' .x-grid-split-',i," { ",O,N,'height:',(B-4),"px;}\n");}}Roo.log(A.join(''));this.CSS.createStyleSheet(A.join(''),this.id+'-cssrules');
+},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;}if(B.findParent('thead',false,true)){if(e.getTarget().nodeName.toLowerCase()!='th'){B=Roo.get(t).findParent('th',false,true);
+if(!B){Roo.log("failed to find th in thead?");Roo.log(e.getTarget());return;}}var C=B.dom.cellIndex;var D=A=='touchstart'?'click':A;this.fireEvent("header"+D,this,C,e);return;}if(e.getTarget().nodeName.toLowerCase()!='td'){B=Roo.get(t).findParent('td',false,true);
+if(!B){Roo.log("failed to find th in tbody?");Roo.log(e.getTarget());return;}}var E=B.findParent('tr',false,true);var C=B.dom.cellIndex;var F=E.dom.rowIndex-1;if(E!==false){this.fireEvent("row"+A,this,F,e);if(B!==false){this.fireEvent("cell"+A,this,F,C,e);
+}}},onMouseover:function(e,el){var A=Roo.get(el);if(!A){return;}if(e.getTarget().nodeName.toLowerCase()!='td'){A=A.findParent('td',false,true);}var B=A.findParent('tr',false,true);var C=A.dom.cellIndex;var D=B.dom.rowIndex-1;this.fireEvent('mouseover',this,A,D,C,e);
+},onMouseout:function(e,el){var A=Roo.get(el);if(!A){return;}if(e.getTarget().nodeName.toLowerCase()!='td'){A=A.findParent('td',false,true);}var B=A.findParent('tr',false,true);var C=A.dom.cellIndex;var D=B.dom.rowIndex-1;this.fireEvent('mouseout',this,A,D,C,e);
+},onClick: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);this.fireEvent('cellclick',this,A,D,C,e);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);}},findRowIndex:function(el){var A=Roo.get(el);if(!A){return false;}var B=A.findParent('tr',false,true);if(!B||typeof(B)=='undefined'){return false;}return this.getRowIndex(B);},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('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.dataIndex)!='undefined'){c.sort=C.dataIndex;}if(typeof(C.align)!='undefined'&&C.align.length){c.style+=' text-align:'+C.align+';';}if(typeof(C.cls)!='undefined'){c.cls=(typeof(c.cls)=='undefined')?C.cls:(c.cls+' '+C.cls);
+}c.html+=' <span class="x-grid-split x-grid-split-'+i+'"></span>';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.bodyEl;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();this.initCSS();},onUpdate:function(ds,A){this.refreshRow(A);this.autoSize();},onRemove:function(ds,A,B,C){if(C!==true){this.fireEvent("beforerowremoved",this,B,A);}var bt=this.bodyEl.dom;var D=this.el.select('tbody > tr',true).elements;
+if(typeof(D[B])!='undefined'){bt.removeChild(D[B].dom);}if(C!==true){this.fireEvent("rowremoved",this,B,A);}},onAdd:function(ds,A,B){var bt=this.bodyEl.dom;for(var i=0;i<A.length;i++){this.insertRow(this.store,B+i,false);return;}},refreshRow:function(A){var ds=this.store,B;
+if(typeof A=='number'){B=A;A=ds.getAt(B);}else{B=ds.indexOf(A);if(B<0){return;}}this.insertRow(ds,B,true);this.autoSize();this.onRemove(ds,A,B+1,true);this.autoSize();this.fireEvent("rowupdated",this,B,A);},onRowSelect:function(A){var B=this.getRowDom(A);
+B.addClass(['bg-info','info']);},onRowDeselect:function(A){if(A<0){return;}var B=this.getRowDom(A);B.removeClass(['bg-info','info']);},focusRow:function(A){var x=this.bodyEl.dom.scrollLeft;this.focusCell(A,0,false);this.bodyEl.dom.scrollLeft=x;},focusCell:function(A,B,C){var el=this.ensureVisible(A,B,C);
+},ensureVisible:function(A,B,C){if(typeof A!="number"){A=A.rowIndex;}if(A<0&&A>=this.ds.getCount()){return null;}B=(B!==undefined?B:0);var cm=this.cm;while(cm.isHidden(B)){B++;}var el=this.getCellDom(A,B);if(!el){return null;}var c=this.bodyEl.dom;var D=parseInt(el.offsetTop,10);
+var E=parseInt(el.offsetLeft,10);var F=D+el.offsetHeight;var G=E+el.offsetWidth;var ch=0;var H=parseInt(c.scrollTop,10);var I=parseInt(c.scrollLeft,10);var J=H+ch;var K=I+c.clientWidth;if(D<H){c.scrollTop=D;}else if(F>J){c.scrollTop=F-ch;}if(C!==false){if(E<I){c.scrollLeft=E;
+}else if(G>K){c.scrollLeft=G-c.clientWidth;}}return el;},insertRow:function(dm,A,B){if(!B){this.fireEvent("beforerowsinserted",this,A);}var C=this.renderRow(this.cm,this.store,A);var e=this.bodyEl.createChild(C,this.getRowDom(A));var D=this;if(C.cellObjects.length){Roo.each(C.cellObjects,function(r){D.renderCellObject(r);
+})}if(!B){this.fireEvent("rowsinserted",this,A);}},getRowDom:function(A){var B=this.el.select('tbody > tr',true).elements;return (typeof(B[A])=='undefined')?false:B[A];},getCellDom:function(A,B){var C=this.getRowDom(A);if(C===false){return false;}var D=C.select('td',true).elements;
+return (typeof(D[B])=='undefined')?false:D[B];},renderRow:function(cm,ds,A){var d=ds.getAt(A);var B={tag:'tr',cls:'x-row-'+A,cn:[]};var C=[];for(var i=0,D=cm.getColumnCount();i<D;i++){var E=cm.config[i];var F=cm.getRenderer(i);var G='';var id=false;if(typeof(F)!=='undefined'){G=F(d.data[cm.getDataIndex(i)],false,d);
+}if(typeof(G)==='object'){id=Roo.id();C.push({container:id,cfg:G})}var H={record:d,rowIndex:A,colIndex:i,rowClass:''};this.fireEvent('rowclass',this,H);var td={tag:'td',cls:H.rowClass+' x-col-'+i,style:'',html:(typeof(G)==='object')?'':G};if(id){td.id=id;
+}if(typeof(E.colspan)!='undefined'){td.colspan=E.colspan;}if(typeof(E.align)!='undefined'&&E.align.length){td.style+=' text-align:'+E.align+';';}if(typeof(E.valign)!='undefined'&&E.valign.length){td.style+=' vertical-align:'+E.valign+';';}if(typeof(E.cursor)!='undefined'){td.style+=' cursor:'+E.cursor+';';
+}if(typeof(E.cls)!='undefined'){td.cls=(typeof(td.cls)=='undefined')?E.cls:(td.cls+' '+E.cls);}B.cn.push(td);}B.cellObjects=C;return B;},onBeforeLoad:function(){},clear:function(){this.el.select('tbody',true).first().dom.innerHTML='';},setRowVisibility:function(A,B){var bt=this.bodyEl.dom;
+var C=this.el.select('tbody > tr',true).elements;if(typeof(C[A])=='undefined'){return;}C[A][B?'removeClass':'addClass']('d-none');},getSelectionModel:function(){if(!this.selModel){this.selModel=new Roo.bootstrap.Table.RowSelectionModel({grid:this});}return this.selModel;
+},renderCellObject:function(r){var A=this;r.cfg.parentId=(typeof(r.container)=='string')?r.container:r.container.id;var t=r.cfg.render(r.container);if(r.cfg.cn){Roo.each(r.cfg.cn,function(c){var B={container:t.getChildContainer(),cfg:c};A.renderCellObject(B);
+})}},getRowIndex:function(A){var B=-1;Roo.each(this.el.select('tbody > tr',true).elements,function(el,C){if(el!=A){return;}B=C;});return B;},getHeaderIndex:function(A){var B=this.headEl.select('th',true).elements;return B[A];},getCellIndex:function(A){var id=String(A.className).match(Roo.bootstrap.Table.cellRE);
+if(id){return parseInt(id[1],10);}return 0;},getGridEl:function(){return this.el;},autoSize:function(){var A=Roo.get(this.el.dom);var B=this.getGridEl().select('thead',true).first();var C=this.getGridEl().select('tbody',true).first();var D=this.getGridEl().select('tfoot',true).first();
+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);this.initCSS();
+return;},onBodyScroll:function(){if(this.headEl){this.headEl.setStyle({'position':'relative','left':(-1*this.bodyEl.dom.scrollLeft)+'px'});}if(this.lazyLoad){var A=this.bodyEl.dom.scrollHeight;var B=Math.ceil(this.bodyEl.getScroll().top);var C=this.bodyEl.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});}}}},onColumnSplitterMoved:function(i,A){this.userResized=true;
+var cm=this.colModel;var w=this.getHeaderIndex(i).getWidth()+A;cm.setColumnWidth(i,w,true);this.initCSS();this.fireEvent("columnresize",i,w);},onHeaderChange:function(){var A=this.renderHeader();var B=this.el.select('table',true).first();this.headEl.remove();
+this.headEl=B.createChild(A,this.bodyEl,false);Roo.each(this.el.select('thead th.sortable',true).elements,function(e){e.on('click',this.sort,this);},this);if(this.enableColumnResize!==false&&Roo.grid.SplitDragZone){new Roo.grid.SplitDragZone(this,this.headEl.dom,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];}}});Roo.bootstrap.Table.cellRE=/(?:.*?)x-grid-(?:hd|cell|split)-([\d]+)(?:.*?)/;Roo.bootstrap.Table.AbstractSelectionModel=Roo.grid.AbstractSelectionModel;Roo.bootstrap.Table.RowSelectionModel=Roo.grid.RowSelectionModel;
+
 // 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}
@@ -1135,30 +1177,6 @@ if(!this.editing){this.inputEl().setHeight(Math.min(500,Math.max(sh,(this.getVal
 this.editing=false;return;},updateMarkdown:function(){if(this.getValue()==''){this.markdownEl.dom.innerHTML=String.format('<span class="roo-placeholder">{0}</span>',this.placeholder||'');return;}this.markdownEl.dom.innerHTML=Roo.Markdown.toHtml(Roo.util.Format.htmlEncode(this.getValue()));
 },resizeTextArea:function(){var sh=100;Roo.log([sh,this.getValue().split("\n").length*30]);this.inputEl().setHeight(Math.min(500,Math.max(sh,(this.getValue().split("\n").length+1)*30)));},setValue:function(A){Roo.bootstrap.TextArea.prototype.setValue.call(this,A);
 if(!this.editing){this.updateMarkdown();}},focus:function(){if(!this.editing){this.toggleTextEdit();}}});
-// Roo/bootstrap/Table/AbstractSelectionModel.js
-Roo.bootstrap.Table.AbstractSelectionModel=function(){this.locked=false;Roo.bootstrap.Table.AbstractSelectionModel.superclass.constructor.call(this);};Roo.extend(Roo.bootstrap.Table.AbstractSelectionModel,Roo.util.Observable,{init:function(A){this.grid=A;this.initEvents();
-},lock:function(){this.locked=true;},unlock:function(){this.locked=false;},isLocked:function(){return this.locked;},initEvents:function(){}});
-// Roo/bootstrap/Table/RowSelectionModel.js
-Roo.bootstrap.Table.RowSelectionModel=function(A){Roo.apply(this,A);this.selections=new Roo.util.MixedCollection(false,function(o){return o.id;});this.last=false;this.lastActive=false;this.addEvents({"selectionchange":true,"afterselectionchange":true,"beforerowselect":true,"rowselect":true,"rowdeselect":true}
-);Roo.bootstrap.Table.RowSelectionModel.superclass.constructor.call(this);this.locked=false;};Roo.extend(Roo.bootstrap.Table.RowSelectionModel,Roo.bootstrap.Table.AbstractSelectionModel,{singleSelect:false,initEvents:function(){this.grid.on("rowclick",this.handleMouseDown,this);
-this.rowNav=new Roo.KeyNav(this.grid.getGridEl(),{"up":function(e){if(!e.shiftKey){this.selectPrevious(e.shiftKey);}else if(this.last!==false&&this.lastActive!==false){var A=this.last;this.selectRange(this.last,this.lastActive-1);this.grid.getView().focusRow(this.lastActive);
-if(A!==false){this.last=A;}}else{this.selectFirstRow();}this.fireEvent("afterselectionchange",this);},"down":function(e){if(!e.shiftKey){this.selectNext(e.shiftKey);}else if(this.last!==false&&this.lastActive!==false){var A=this.last;this.selectRange(this.last,this.lastActive+1);
-this.grid.getView().focusRow(this.lastActive);if(A!==false){this.last=A;}}else{this.selectFirstRow();}this.fireEvent("afterselectionchange",this);},scope:this});this.grid.store.on('load',function(){this.selections.clear();},this);},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){v.onRowSelect(i);}else{s.remove(r);}});},onRemove:function(v,A,r){this.selections.remove(r);},onRowUpdated:function(v,A,r){if(this.isSelected(r)){v.onRowSelect(A);}},selectRecords:function(A,B){if(!B){this.clearSelections();
-}var ds=this.grid.store;for(var i=0,C=A.length;i<C;i++){this.selectRow(ds.indexOf(A[i]),true);}},getCount:function(){return this.selections.length;},selectFirstRow:function(){this.selectRow(0);},selectLastRow:function(A){this.selectRow(this.grid.store.getCount()-1,A);
-},selectNext:function(A){if(this.last!==false&&(this.last+1)<this.grid.store.getCount()){this.selectRow(this.last+1,A);this.grid.getView().focusRow(this.last);}},selectPrevious:function(A){if(this.last){this.selectRow(this.last-1,A);this.grid.getView().focusRow(this.last);
-}},getSelections:function(){return [].concat(this.selections.items);},getSelected:function(){return this.selections.itemAt(0);},clearSelections:function(A){if(this.locked){return;}if(A!==true){var ds=this.grid.store;var s=this.selections;s.each(function(r){this.deselectRow(ds.indexOfId(r.id));
-},this);s.clear();}else{this.selections.clear();}this.last=false;},selectAll:function(){if(this.locked){return;}this.selections.clear();for(var i=0,A=this.grid.store.getCount();i<A;i++){this.selectRow(i,true);}},hasSelection:function(){return this.selections.length>0;
-},isSelected:function(A){var r=typeof A=="number"?this.grid.store.getAt(A):A;return (r&&this.selections.key(r.id)?true:false);},isIdSelected:function(id){return (this.selections.key(id)?true:false);},handleMouseDBClick:function(e,t){},handleMouseDown:function(e,t){var A=this.grid.headerShow?t.dom.rowIndex-1:t.dom.rowIndex;
-if(this.isLocked()||A<0){return;};if(e.shiftKey&&this.last!==false){var B=this.last;this.selectRange(B,A,e.ctrlKey);this.last=B;t.focus();}else{var C=this.isSelected(A);if(C){this.deselectRow(A);}else{this.selectRow(A,true);}}this.fireEvent("afterselectionchange",this);
-},handleDragableRowClick:function(A,B,e){if(e.button===0&&!e.shiftKey&&!e.ctrlKey){this.selectRow(B,false);A.view.focusRow(B);this.fireEvent("afterselectionchange",this);}},selectRows:function(A,B){if(!B){this.clearSelections();}for(var i=0,C=A.length;i<C;
-i++){this.selectRow(A[i],true);}},selectRange:function(A,B,C){if(this.locked){return;}if(!C){this.clearSelections();}if(A<=B){for(var i=A;i<=B;i++){this.selectRow(i,true);}}else{for(var i=A;i>=B;i--){this.selectRow(i,true);}}},deselectRange:function(A,B,C){if(this.locked){return;
-}for(var i=A;i<=B;i++){this.deselectRow(i,C);}},selectRow:function(A,B,C){if(this.locked||(A<0||A>this.grid.store.getCount())){return;}if(this.fireEvent("beforerowselect",this,A,B)!==false){if(!B||this.singleSelect){this.clearSelections();}var r=this.grid.store.getAt(A);
-this.selections.add(r);this.last=this.lastActive=A;if(!C){var D=new Roo.Element(this.grid.getRowDom(A));D.addClass('bg-info info');}this.fireEvent("rowselect",this,A,r);this.fireEvent("selectionchange",this);}},deselectRow:function(A,B){if(this.locked){return;
-}if(this.last==A){this.last=false;}if(this.lastActive==A){this.lastActive=false;}var r=this.grid.store.getAt(A);if(!r){return;}this.selections.remove(r);if(!B){var C=new Roo.Element(this.grid.getRowDom(A));C.removeClass('bg-info info');}this.fireEvent("rowdeselect",this,A);
-this.fireEvent("selectionchange",this);},restoreLast:function(){if(this._last){this.last=this._last;}},acceptsNav:function(A,B,cm){return !cm.isHidden(B)&&cm.isCellEditable(B,A);},onEditorKey:function(A,e){var k=e.getKey(),B,g=this.grid,ed=g.activeEditor;
-if(k==e.TAB){e.stopEvent();ed.completeEdit();if(e.shiftKey){B=g.walkCells(ed.row,ed.col-1,-1,this.acceptsNav,this);}else{B=g.walkCells(ed.row,ed.col+1,1,this.acceptsNav,this);}}else if(k==e.ENTER&&!e.ctrlKey){e.stopEvent();ed.completeEdit();if(e.shiftKey){B=g.walkCells(ed.row-1,ed.col,-1,this.acceptsNav,this);
-}else{B=g.walkCells(ed.row+1,ed.col,1,this.acceptsNav,this);}}else if(k==e.ESC){ed.cancelEdit();}if(B){g.startEditing(B[0],B[1]);}}});
 // Roo/bootstrap/PagingToolbar.js
 Roo.bootstrap.PagingToolbar=function(A){this.ds=A.dataSource;if(A.store&&!this.ds){this.store=Roo.factory(A.store,Roo.data);this.ds=this.store;this.ds.xmodule=this.xmodule||false;}this.toolbarItems=[];if(A.items){this.toolbarItems=A.items;}Roo.bootstrap.PagingToolbar.superclass.constructor.call(this,A);
 this.cursor=0;if(this.ds){this.bind(this.ds);}if(Roo.bootstrap.version==4){this.navgroup=new Roo.bootstrap.ButtonGroup({cls:'pagination'});}else{this.navgroup=new Roo.bootstrap.NavGroup({cls:'pagination'});}};Roo.extend(Roo.bootstrap.PagingToolbar,Roo.bootstrap.NavSimplebar,{pageSize:20,displayMsg:'Displaying {0} - {1} of {2}',emptyMsg:'No data to display',beforePageText:"Page",afterPageText:"of {0}",firstText:"First Page",prevText:"Previous Page",nextText:"Next Page",lastText:"Last Page",refreshText:"Refresh",buttons:false,onRender:function(ct,A){Roo.bootstrap.PagingToolbar.superclass.onRender.call(this,ct,A);