popover column resizing on grids
authorAlan Knowles <alan@roojs.com>
Wed, 18 Aug 2021 08:31:19 +0000 (16:31 +0800)
committerAlan Knowles <alan@roojs.com>
Wed, 18 Aug 2021 08:31:19 +0000 (16:31 +0800)
Roo/bootstrap/Table.js
docs/src/Roo_data_HttpProxy.js.html
roojs-all.js
roojs-bootstrap-debug.js
roojs-bootstrap.js
roojs-debug.js
roojs-ui-debug.js
roojs-ui.js

index 6ece84b..c7ba3e3 100644 (file)
@@ -82,11 +82,12 @@ Currently the Table  uses multiple headers to try and handle XL / Medium etc...
  * @cfg {Boolean} headerShow (true|false) generate thead, default true
  * @cfg {Boolean} rowSelection (true|false) default false
  * @cfg {Boolean} cellSelection (true|false) default false
- * @cfg {Boolean} scrollBody (true|false) default false - body scrolled / fixed header
+ * @cfg {Boolean} scrollBody (true|false) default false - body scrolled / fixed header (with resizable columns)
  * @cfg {Roo.bootstrap.PagingToolbar} footer  a paging toolbar
  * @cfg {Boolean} lazyLoad  auto load data while scrolling to the end (default false)
  * @cfg {Boolean} auto_hide_footer  auto hide footer if only one page (default false)
- * @cfg {Boolean} enableColumnResize default true if columns can be resized (drag/drop)
+ * @cfg {Boolean} enableColumnResize default true if columns can be resized = needs scrollBody to be set to work (drag/drop)
+ * 
  * @cfg {Number} minColumnWidth default 50 pixels minimum column width 
  * 
  * @constructor
@@ -499,7 +500,9 @@ Roo.extend(Roo.bootstrap.Table, Roo.bootstrap.Component,  {
                 }
                 
                 styles.push('#' , this.id , ' .x-hcol-' , i, " { ", width, hidden," }\n",
-                            '#' , this.id , ' .x-grid-split-' , i, " { ", left, splithide,'height:', (headHeight - 4), "px;}\n"
+                            '#' , this.id , ' .x-grid-split-' , i, " { ", left, splithide, 'height:', (headHeight - 4), "px;}\n",
+                            // this is the popover version..
+                            '.popover-inner #' , this.id , ' .x-grid-split-' , i, " { ", left, splithide, 'height:', 100, "%;}\n"
                 );
             }
             
index 7cf5d1a..52b00a8 100644 (file)
             </span><span class="jsdoc-var">o.request.callback.call</span><span class="jsdoc-syntax">(</span><span class="jsdoc-var">o.request.scope</span><span class="jsdoc-syntax">, {
                     </span><span class="jsdoc-var">success </span><span class="jsdoc-syntax">: </span><span class="jsdoc-keyword">false</span><span class="jsdoc-syntax">,
                     </span><span class="jsdoc-var">raw </span><span class="jsdoc-syntax">: {
-                        </span><span class="jsdoc-var">errorMsg </span><span class="jsdoc-syntax">: </span><span class="jsdoc-var">response
+                        </span><span class="jsdoc-var">errorMsg </span><span class="jsdoc-syntax">: </span><span class="jsdoc-var">response.responseText
                     </span><span class="jsdoc-syntax">}
 
                 }, </span><span class="jsdoc-var">o.request.arg</span><span class="jsdoc-syntax">, </span><span class="jsdoc-keyword">false</span><span class="jsdoc-syntax">);
index 1e86893..a5cb448 100644 (file)
@@ -962,7 +962,7 @@ Roo.data.MemoryProxy=function(A){if(A.data){A=A.data;}Roo.data.MemoryProxy.super
 Roo.data.HttpProxy=function(A){Roo.data.HttpProxy.superclass.constructor.call(this);this.conn=A;this.useAjax=!A||!A.events;};Roo.extend(Roo.data.HttpProxy,Roo.data.DataProxy,{getConnection:function(){return this.useAjax?Roo.Ajax:this.conn;},load:function(A,B,C,D,E){if(this.fireEvent("beforeload",this,A)!==false){var o={params:A||{}
 ,request:{callback:C,scope:D,arg:E},reader:B,callback:this.loadResponse,scope:this};if(this.useAjax){Roo.applyIf(o,this.conn);if(this.activeRequest){Roo.Ajax.abort(this.activeRequest);}this.activeRequest=Roo.Ajax.request(o);}else{this.conn.request(o);}}else{C.call(D||this,null,E,false);
 }},loadResponse:function(o,A,B){delete this.activeRequest;if(!A){this.fireEvent("loadexception",this,o,B);o.request.callback.call(o.request.scope,null,o.request.arg,false);return;}var C;try{C=o.reader.read(B);}catch(e){this.fireEvent("loadexception",this,o,B,e);
-o.request.callback.call(o.request.scope,{success:false,raw:{errorMsg:B}},o.request.arg,false);return;}this.fireEvent("load",this,o,o.request.arg);o.request.callback.call(o.request.scope,C,o.request.arg,true);},update:function(A){},updateResponse:function(A){}
+o.request.callback.call(o.request.scope,{success:false,raw:{errorMsg:B.responseText}},o.request.arg,false);return;}this.fireEvent("load",this,o,o.request.arg);o.request.callback.call(o.request.scope,C,o.request.arg,true);},update:function(A){},updateResponse:function(A){}
 });
 // Roo/data/ScriptTagProxy.js
 Roo.data.ScriptTagProxy=function(A){Roo.data.ScriptTagProxy.superclass.constructor.call(this);Roo.apply(this,A);this.head=document.getElementsByTagName("head")[0];};Roo.data.ScriptTagProxy.TRANS_ID=1000;Roo.extend(Roo.data.ScriptTagProxy,Roo.data.DataProxy,{timeout:30000,callbackParam:"callback",nocache:true,load:function(A,B,C,D,E){if(this.fireEvent("beforeload",this,A)!==false){var p=Roo.urlEncode(Roo.apply(A,this.extraParams));
index b11f948..9e6e7e8 100644 (file)
@@ -9148,11 +9148,12 @@ Currently the Table  uses multiple headers to try and handle XL / Medium etc...
  * @cfg {Boolean} headerShow (true|false) generate thead, default true
  * @cfg {Boolean} rowSelection (true|false) default false
  * @cfg {Boolean} cellSelection (true|false) default false
- * @cfg {Boolean} scrollBody (true|false) default false - body scrolled / fixed header
+ * @cfg {Boolean} scrollBody (true|false) default false - body scrolled / fixed header (with resizable columns)
  * @cfg {Roo.bootstrap.PagingToolbar} footer  a paging toolbar
  * @cfg {Boolean} lazyLoad  auto load data while scrolling to the end (default false)
  * @cfg {Boolean} auto_hide_footer  auto hide footer if only one page (default false)
- * @cfg {Boolean} enableColumnResize default true if columns can be resized (drag/drop)
+ * @cfg {Boolean} enableColumnResize default true if columns can be resized = needs scrollBody to be set to work (drag/drop)
+ * 
  * @cfg {Number} minColumnWidth default 50 pixels minimum column width 
  * 
  * @constructor
@@ -9565,7 +9566,9 @@ Roo.extend(Roo.bootstrap.Table, Roo.bootstrap.Component,  {
                 }
                 
                 styles.push('#' , this.id , ' .x-hcol-' , i, " { ", width, hidden," }\n",
-                            '#' , this.id , ' .x-grid-split-' , i, " { ", left, splithide,'height:', (headHeight - 4), "px;}\n"
+                            '#' , this.id , ' .x-grid-split-' , i, " { ", left, splithide, 'height:', (headHeight - 4), "px;}\n",
+                            // this is the popover version..
+                            '.popover-inner #' , this.id , ' .x-grid-split-' , i, " { ", left, splithide, 'height:', 100, "%;}\n"
                 );
             }
             
index de48813..2ef7132 100644 (file)
@@ -405,7 +405,7 @@ this.resizeProxy=Roo.get(document.body).createChild({cls:"x-grid-resize-proxy",h
 },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;";
-}if(this.responsive){L='';O='';K=cm.isHidden(i)?'display:none;':'';N='display: none;';}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");
+}if(this.responsive){L='';O='';K=cm.isHidden(i)?'display:none;':'';N='display: none;';}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",'.popover-inner #',this.id,' .x-grid-split-',i," { ",O,N,'height:',100,"%;}\n");
 }}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;
index f2024bc..d0e53e5 100644 (file)
@@ -24733,7 +24733,7 @@ Roo.extend(Roo.data.HttpProxy, Roo.data.DataProxy, {
             o.request.callback.call(o.request.scope, {
                     success : false,
                     raw : {
-                        errorMsg : response
+                        errorMsg : response.responseText
                     }
                     
                 }, o.request.arg, false);
index eba698e..3e7cd56 100644 (file)
@@ -1568,7 +1568,7 @@ Roo.extend(Roo.data.HttpProxy, Roo.data.DataProxy, {
             o.request.callback.call(o.request.scope, {
                     success : false,
                     raw : {
-                        errorMsg : response
+                        errorMsg : response.responseText
                     }
                     
                 }, o.request.arg, false);
index 0bf8631..57e91ba 100644 (file)
@@ -59,7 +59,7 @@ Roo.data.MemoryProxy=function(A){if(A.data){A=A.data;}Roo.data.MemoryProxy.super
 Roo.data.HttpProxy=function(A){Roo.data.HttpProxy.superclass.constructor.call(this);this.conn=A;this.useAjax=!A||!A.events;};Roo.extend(Roo.data.HttpProxy,Roo.data.DataProxy,{getConnection:function(){return this.useAjax?Roo.Ajax:this.conn;},load:function(A,B,C,D,E){if(this.fireEvent("beforeload",this,A)!==false){var o={params:A||{}
 ,request:{callback:C,scope:D,arg:E},reader:B,callback:this.loadResponse,scope:this};if(this.useAjax){Roo.applyIf(o,this.conn);if(this.activeRequest){Roo.Ajax.abort(this.activeRequest);}this.activeRequest=Roo.Ajax.request(o);}else{this.conn.request(o);}}else{C.call(D||this,null,E,false);
 }},loadResponse:function(o,A,B){delete this.activeRequest;if(!A){this.fireEvent("loadexception",this,o,B);o.request.callback.call(o.request.scope,null,o.request.arg,false);return;}var C;try{C=o.reader.read(B);}catch(e){this.fireEvent("loadexception",this,o,B,e);
-o.request.callback.call(o.request.scope,{success:false,raw:{errorMsg:B}},o.request.arg,false);return;}this.fireEvent("load",this,o,o.request.arg);o.request.callback.call(o.request.scope,C,o.request.arg,true);},update:function(A){},updateResponse:function(A){}
+o.request.callback.call(o.request.scope,{success:false,raw:{errorMsg:B.responseText}},o.request.arg,false);return;}this.fireEvent("load",this,o,o.request.arg);o.request.callback.call(o.request.scope,C,o.request.arg,true);},update:function(A){},updateResponse:function(A){}
 });
 // Roo/data/ScriptTagProxy.js
 Roo.data.ScriptTagProxy=function(A){Roo.data.ScriptTagProxy.superclass.constructor.call(this);Roo.apply(this,A);this.head=document.getElementsByTagName("head")[0];};Roo.data.ScriptTagProxy.TRANS_ID=1000;Roo.extend(Roo.data.ScriptTagProxy,Roo.data.DataProxy,{timeout:30000,callbackParam:"callback",nocache:true,load:function(A,B,C,D,E){if(this.fireEvent("beforeload",this,A)!==false){var p=Roo.urlEncode(Roo.apply(A,this.extraParams));