X-Git-Url: http://git.roojs.org/?p=roojs1;a=blobdiff_plain;f=roojs-debug.js;h=1cda431fb38d359f9d8f612814b13f88fd44ef92;hp=3715c6f9d6a9893177dcc3ac70759f164fb3c7b1;hb=8673c23959602f121d1fb75c6a7ec7a656352897;hpb=f4700f0511a9842ccb588098b291c50d855ce574 diff --git a/roojs-debug.js b/roojs-debug.js index 3715c6f9d6..1cda431fb3 100644 --- a/roojs-debug.js +++ b/roojs-debug.js @@ -55485,26 +55485,36 @@ Roo.extend(Roo.grid.Grid, Roo.util.Observable, { this.view.refresh(true); }, /** - * addColumn + * addColumns * Add's a column, default at the end.. - * @param {Object} column configuration see {@link Roo.grid.ColumnModel} + * @param {int} position to add (default end) + * @param {Array} of objects of column configuration see {@link Roo.grid.ColumnModel} */ - addColumn : function(cfg, pos) + addColumns : function(pos, ar) { - 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; + + 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; } - // splice + + + if (typeof(pos) == 'undefined' || pos >= this.cm.config.length) { + pos = this.cm.config.length; //this.cm.config.push(cfg); + } pos = Math.max(0,pos); - this.cm.config.splice(pos, 0, cfg); + ar.unshift(0); + ar.unshift(pos); + this.cm.config.splice.apply(this.cm.config, ar); + + + + this.view.generateRules(this.cm); this.view.refresh(true); - } + },