X-Git-Url: http://git.roojs.org/?p=roojs1;a=blobdiff_plain;f=roojs-ui-debug.js;h=b4b532f2a5ed1c53fcf8e3be17fde2e16f9cec83;hp=535682fd4d4cbf51532d242b82b22c40e628cce1;hb=8673c23959602f121d1fb75c6a7ec7a656352897;hpb=7fe4242102bafb8a17b55eef76da37fc044c5d87 diff --git a/roojs-ui-debug.js b/roojs-ui-debug.js index 535682fd4d..b4b532f2a5 100644 --- a/roojs-ui-debug.js +++ b/roojs-ui-debug.js @@ -33000,27 +33000,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; } - // slice + + + 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.cm.config.splice(pos, 0, cfg); + + this.view.generateRules(this.cm); this.view.refresh(true); - } + },