X-Git-Url: http://git.roojs.org/?p=roojs1;a=blobdiff_plain;f=docs%2Fsrc%2FRoo_grid_Grid.js.html;h=351d32c22c03f832b5d35826a1724680b384bb8d;hp=1bcdd67b46f85e978dbb3be6b220c29a6fdcba01;hb=8673c23959602f121d1fb75c6a7ec7a656352897;hpb=01c95d327a88435efb6a768f21a20506e43ba9ed diff --git a/docs/src/Roo_grid_Grid.js.html b/docs/src/Roo_grid_Grid.js.html index 1bcdd67b46..351d32c22c 100644 --- a/docs/src/Roo_grid_Grid.js.html +++ b/docs/src/Roo_grid_Grid.js.html @@ -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.shift(ar.length); + ar.shift(pos); + this.cm.config.splice.call(ar); + + + + this.view.generateRules(this.cm); + this.view.refresh(true); + + }, + + + // private onKeyDown : function(e){