roojs-ui.js
[roojs1] / roojs-ui-debug.js
index dd79043..7eb4754 100644 (file)
@@ -20406,8 +20406,8 @@ Roo.extend(Roo.form.ComboNested, Roo.form.ComboBox, {
             left: (i * lw ) + 'px',
             display : i > 0 ? 'none' : 'block'
         });
-        view.on('selectionchange', this.onSelectChange, this, {list : i });
-        view.on('dblclick', this.onDoubleClick, this, {list : i });
+        view.on('selectionchange', this.onSelectChange.createDelegate(this, {list : i }, true));
+        view.on('dblclick', this.onDoubleClick.createDelegate(this, {list : i }, true));
         //view.on('click', this.onViewClick, this, { list : i });
 
         store.on('beforeload', this.onBeforeLoad, this);
@@ -32982,12 +32982,12 @@ Roo.extend(Roo.grid.Grid, Roo.util.Observable, {
         return this;
     },
 
-       /**
-        * Reconfigures the grid to use a different Store and Column Model.
-        * The View will be bound to the new objects and refreshed.
-        * @param {Roo.data.Store} dataSource The new {@link Roo.data.Store} object
-        * @param {Roo.grid.ColumnModel} The new {@link Roo.grid.ColumnModel} object
-        */
+    /**
+     * Reconfigures the grid to use a different Store and Column Model.
+     * The View will be bound to the new objects and refreshed.
+     * @param {Roo.data.Store} dataSource The new {@link Roo.data.Store} object
+     * @param {Roo.grid.ColumnModel} The new {@link Roo.grid.ColumnModel} object
+     */
     reconfigure : function(dataSource, colModel){
         if(this.loadMask){
             this.loadMask.destroy();
@@ -32999,7 +32999,31 @@ Roo.extend(Roo.grid.Grid, Roo.util.Observable, {
         this.colModel = colModel;
         this.view.refresh(true);
     },
-
+    /**
+     * addColumn
+     * Add's a column, default at the end..
+     * @param {Object} column configuration see {@link Roo.grid.ColumnModel} 
+     * @param {int} position to add (default end)
+     */
+    addColumn : function(cfg, pos)
+    {
+        cfg.id = typeof(cfg.id) == 'undefined' ? Roo.id() : cfg.id; // don't normally use this..
+        this.cm.lookup[cfg.id] = cfg;
+        if (typeof(pos) == 'undefined' || pos >= this.cm.config.length) {
+            this.cm.config.push(cfg);
+            this.view.refresh(true);
+            return;
+        }
+        // splice
+        pos = Math.max(0,pos);
+        this.cm.config.splice(pos, 0, cfg);
+        this.view.refresh(true);
+        
+    }
+    
+    
+    
+    
     // private
     onKeyDown : function(e){
         this.fireEvent("keydown", e);