Roo/bootstrap/Table.js
[roojs1] / Roo / bootstrap / Table.js
index d751266..4da366e 100644 (file)
@@ -1168,21 +1168,59 @@ Roo.extend(Roo.bootstrap.Table, Roo.bootstrap.Component,  {
         
         var rows = this.el.dom.getElementsByClassName("x-col-"+col_index);
         
+        var h_row = this.el.dom.getElementsByClassName("x-hcol-"+col_index);
+        
+        
+        for(var j = 0; j < w.length; j++) {
+            
+            if(!w[j]) {
+                continue;
+            }
+            
+            var size_cls = w[j].split("-");
+            
+            if(!Number.isInteger(size_cls[1] * 1)) {
+                continue;
+            }
+            
+            if(!this.colModel.config[col_index][size_cls[0]]) {
+                continue;
+            }
+            
+            if(!h_row[0].classList.contains("col-"+size_cls[0]+"-"+this.colModel.config[col_index][size_cls[0]])) {
+                continue;
+            }
+            
+            h_row[0].classList.replace(
+                "col-"+size_cls[0]+"-"+this.colModel.config[col_index][size_cls[0]],
+                "col-"+size_cls[0]+"-"+size_cls[1]
+            );
+            
+            this.colModel.config[col_index][size_cls[0]] = size_cls[1];
+        }
+        
         for(var i = 0; i < rows.length; i++) {
             
-            for(var j = 0; w.length; j++) {
+            for(var j = 0; j < w.length; j++) {
                 
                 var size_cls = w[j].split("-");
                 
                 if(!Number.isInteger(size_cls[1] * 1)) {
-                    return;
+                    continue;
                 }
                 
                 if(!this.colModel.config[col_index][size_cls[0]]) {
                     continue;
                 }
                 
-                this.colModel.config[col_index][size_cls[0]]
+                if(!rows[i].classList.contains("col-"+size_cls[0]+"-"+this.colModel.config[col_index][size_cls[0]])) {
+                    continue;
+                }
+                
+                rows[i].classList.replace(
+                    "col-"+size_cls[0]+"-"+this.colModel.config[col_index][size_cls[0]],
+                    "col-"+size_cls[0]+"-"+size_cls[1]
+                );
             }
         }
     }