X-Git-Url: http://git.roojs.org/?p=roojs1;a=blobdiff_plain;f=docs%2Fsrc%2FRoo_grid_Grid.js.html;h=5a50968cd0f79bf8b8752ccc0f8b519e08992ac2;hp=7a349cf619dbf1cdc2c9488bebd8843cf10637a1;hb=5b1a708cf006e24f8f6eb81a4e9723dad77c31cd;hpb=71ba0d6217135dfbf45c3c36f69cec6a293e5fa5 diff --git a/docs/src/Roo_grid_Grid.js.html b/docs/src/Roo_grid_Grid.js.html index 7a349cf619..5a50968cd0 100644 --- a/docs/src/Roo_grid_Grid.js.html +++ b/docs/src/Roo_grid_Grid.js.html @@ -1,4 +1,4 @@ -/home/edward/gitlive/roojs1/Roo/grid/Grid.js/* +Roo/grid/Grid.js/* * Based on: * Ext JS Library 1.1.1 * Copyright(c) 2006-2007, Ext JS, LLC. @@ -484,12 +484,12 @@ 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(); @@ -501,6 +501,40 @@ this.colModel = colModel; this.view.refresh(true); }, + /** + * addColumns + * Add's a column, default at the end.. + + * @param {int} position to add (default end) + * @param {Array} of objects of column configuration see {@link Roo.grid.ColumnModel} + */ + addColumns : function(pos, ar) + { + + for (var i =0;i< ar.length;i++) { + var cfg = ar[i]; + 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) { + pos = this.cm.config.length; //this.cm.config.push(cfg); + } + pos = Math.max(0,pos); + ar.unshift(0); + ar.unshift(pos); + this.cm.config.splice.apply(this.cm.config, ar); + + + + this.view.generateRules(this.cm); + this.view.refresh(true); + + }, + + + // private onKeyDown : function(e){ @@ -723,4 +757,4 @@ * %0 is replaced with the number of selected rows. * @type String */ -Roo.grid.Grid.prototype.ddText = "{0} selected row{1}"; \ No newline at end of file +Roo.grid.Grid.prototype.ddText = "{0} selected row{1}";