X-Git-Url: http://git.roojs.org/?p=roojs1;a=blobdiff_plain;f=roojs-ui-debug.js;h=b4b532f2a5ed1c53fcf8e3be17fde2e16f9cec83;hp=0d2285db4934541b7eba8997eddca43036390323;hb=8673c23959602f121d1fb75c6a7ec7a656352897;hpb=c4ec853f8b86740a021ea3e6669f2d903878a229 diff --git a/roojs-ui-debug.js b/roojs-ui-debug.js index 0d2285db49..b4b532f2a5 100644 --- a/roojs-ui-debug.js +++ b/roojs-ui-debug.js @@ -20406,8 +20406,8 @@ Roo.extend(Roo.form.ComboNested, Roo.form.ComboBox, { left: (i * lw ) + 'px', display : i > 0 ? 'none' : 'block' }); - view.on('selectionchange', this.onSelectChange, this, {list : i }); - view.on('dblclick', this.onDoubleClick, this, {list : i }); + view.on('selectionchange', this.onSelectChange.createDelegate(this, {list : i }, true)); + view.on('dblclick', this.onDoubleClick.createDelegate(this, {list : i }, true)); //view.on('click', this.onViewClick, this, { list : i }); store.on('beforeload', this.onBeforeLoad, this); @@ -25398,14 +25398,20 @@ clientValidation Boolean Applies to submit only. Pass true to call fo // use formdata if (typeof(FormData) != 'undefined' && asString !== true) { - var fd = (new FormData(this.el.dom)).entries(); - var ret = {}; - var ent = fd.next(); - while (!ent.done) { - ret[ent.value[0]] = ent.value[1]; // not sure how this will handle duplicates.. - ent = fd.next(); - }; - return ret; + // this relies on a 'recent' version of chrome apparently... + try { + var fd = (new FormData(this.el.dom)).entries(); + var ret = {}; + var ent = fd.next(); + while (!ent.done) { + ret[ent.value[0]] = ent.value[1]; // not sure how this will handle duplicates.. + ent = fd.next(); + }; + return ret; + } catch(e) { + + } + } @@ -32976,12 +32982,12 @@ Roo.extend(Roo.grid.Grid, Roo.util.Observable, { 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(); @@ -32993,7 +32999,41 @@ Roo.extend(Roo.grid.Grid, Roo.util.Observable, { 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){ this.fireEvent("keydown", e);