X-Git-Url: http://git.roojs.org/?p=roojs1;a=blobdiff_plain;f=roojs-debug.js;h=1cda431fb38d359f9d8f612814b13f88fd44ef92;hp=89e246386925ebafbc4ae994597024c8d6198e75;hb=8673c23959602f121d1fb75c6a7ec7a656352897;hpb=00aea67a314edcbf90382d5930e85c214cf2ee72 diff --git a/roojs-debug.js b/roojs-debug.js index 89e2463869..1cda431fb3 100644 --- a/roojs-debug.js +++ b/roojs-debug.js @@ -6074,11 +6074,9 @@ Roo.util.Observable.releaseCapture = function(o){ var ls = this.listeners, scope, len = ls.length; if(len > 0){ this.firing = true; - + var args = Array.prototype.slice.call(arguments, 0); for(var i = 0; i < len; i++){ - var args = Array.prototype.slice.call(arguments, 0); var l = ls[i]; - args.push(l.options); if(l.fireFn.apply(l.scope||this.obj||window, args) === false){ this.firing = false; return false; @@ -13304,6 +13302,9 @@ mc.add(otherEl); * @return {Object} The item associated with the passed key. */ item : function(key){ + if (key === 'length') { + return null; + } var item = typeof this.map[key] != "undefined" ? this.map[key] : this.items[key]; return typeof item != 'function' || this.allowFunctions ? item : null; // for prototype! }, @@ -15438,7 +15439,7 @@ Roo.extend(Roo.Component, Roo.util.Observable, { /** * @cfg {String} actionMode * which property holds the element that used for hide() / show() / disable() / enable() - * default is 'el' + * default is 'el' for forms you probably want to set this to fieldEl */ actionMode : "el", @@ -42890,8 +42891,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); @@ -55466,12 +55467,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(); @@ -55483,7 +55484,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);