From: Alan Knowles Date: Fri, 8 May 2020 08:41:06 +0000 (+0800) Subject: sync X-Git-Url: http://git.roojs.org/?p=roojs1;a=commitdiff_plain;h=15998029b9f2ae9f00ad0951d00d17d32ff4095b sync --- diff --git a/docs/src/Roo_grid_Grid.js.html b/docs/src/Roo_grid_Grid.js.html index 1bcdd67b46..93dfadbefb 100644 --- a/docs/src/Roo_grid_Grid.js.html +++ b/docs/src/Roo_grid_Grid.js.html @@ -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}";