sync
[roojs1] / roojs-debug.js
index 9e873de..dc8a99c 100644 (file)
@@ -677,7 +677,7 @@ Roo.factory(conf, Roo.data);
                
                getGridSize : function()
                {
-                       var w = Roo.lib.getViewWidth();
+                       var w = Roo.lib.Dom.getViewWidth();
                        switch(true) {
                                case w > 1200:
                                        return 'xl';
@@ -58172,7 +58172,12 @@ Roo.extend(Roo.grid.SplitDragZone, Roo.dd.DDProxy, {
         this.view.headersDisabled = false;
         var endX = Math.max(this.minX, Roo.lib.Event.getPageX(e));
         var diff = endX - this.startPos;
-        this.view.onColumnSplitterMoved(this.cellIndex, this.cm.getColumnWidth(this.cellIndex)+diff);
+        // 
+        var w = this.cm.getColumnWidth(this.cellIndex);
+        if (!this.view.mainWrap) {
+            w = 0;
+        }
+        this.view.onColumnSplitterMoved(this.cellIndex, w+diff);
     },
 
     autoOffset : function(){
@@ -58660,15 +58665,20 @@ Roo.extend(Roo.grid.ColumnModel, Roo.util.Observable, {
     getColumnWidth : function(col, gridSize)
        {
                var cfg = this.config[col];
-               var ret = cfg.width * 1 || this.defaultWidth;
+               
                if (typeof(gridSize) == 'undefined') {
-                       return ret;
+                       return cfg.width * 1 || this.defaultWidth;
+               }
+               if (gridSize === false) { // if we set it..
+                       return cfg.width || false;
                }
-               for(var i in ['xl', 'lg', 'md', 'sm', 'xs']) {
-                       if (typeof(cfg[i]) == 'undefined') {
+               var sizes = ['xl', 'lg', 'md', 'sm', 'xs'];
+               
+               for(var i = sizes.indexOf(gridSize); i < sizes.length; i++) {
+                       if (typeof(cfg[ sizes[i] ] ) == 'undefined') {
                                continue;
                        }
-                       return cfg[i];
+                       return cfg[ sizes[i] ];
                }
                return 1;