X-Git-Url: http://git.ithinksw.org/extjs.git/blobdiff_plain/6e39d509471fe9b4e2660e0d1631b350d0c66f40..6a7e4474cba9d8be4b2ec445e10f1691f7277c50:/examples/ux/RowEditor.js diff --git a/examples/ux/RowEditor.js b/examples/ux/RowEditor.js index 70014f82..813a4dbb 100644 --- a/examples/ux/RowEditor.js +++ b/examples/ux/RowEditor.js @@ -1,6 +1,6 @@ /*! - * Ext JS Library 3.1.0 - * Copyright(c) 2006-2009 Ext JS, LLC + * Ext JS Library 3.2.0 + * Copyright(c) 2006-2010 Ext JS, Inc. * licensing@extjs.com * http://www.extjs.com/license */ @@ -8,11 +8,11 @@ Ext.ns('Ext.ux.grid'); /** * @class Ext.ux.grid.RowEditor - * @extends Ext.Panel + * @extends Ext.Panel * Plugin (ptype = 'roweditor') that adds the ability to rapidly edit full rows in a grid. * A validation mode may be enabled which uses AnchorTips to notify the user of all * validation errors at once. - * + * * @ptype roweditor */ Ext.ux.grid.RowEditor = Ext.extend(Ext.Panel, { @@ -29,7 +29,7 @@ Ext.ux.grid.RowEditor = Ext.extend(Ext.Panel, { monitorValid: true, focusDelay: 250, errorSummary: true, - + saveText: 'Save', cancelText: 'Cancel', commitChangesText: 'You need to commit or cancel your changes', @@ -54,7 +54,7 @@ Ext.ux.grid.RowEditor = Ext.extend(Ext.Panel, { * @event canceledit * Fired when the editor is cancelled. * @param {Ext.ux.grid.RowEditor} roweditor This object - * @param {Boolean} forced True if the cancel button is pressed, false is the editor was invalid. + * @param {Boolean} forced True if the cancel button is pressed, false is the editor was invalid. */ 'canceledit', /** @@ -103,8 +103,8 @@ Ext.ux.grid.RowEditor = Ext.extend(Ext.Panel, { columnresize: this.verifyLayout, columnmove: this.refreshFields, reconfigure: this.refreshFields, - beforedestroy : this.beforedestroy, - destroy : this.destroy, + beforedestroy : this.beforedestroy, + destroy : this.destroy, bodyscroll: { buffer: 250, fn: this.positionButtons @@ -115,9 +115,10 @@ Ext.ux.grid.RowEditor = Ext.extend(Ext.Panel, { }, beforedestroy: function() { + this.stopMonitoring(); this.grid.getStore().un('remove', this.onStoreRemove, this); this.stopEditing(false); - Ext.destroy(this.btns); + Ext.destroy(this.btns, this.tooltip); }, refreshFields: function(){ @@ -149,7 +150,7 @@ Ext.ux.grid.RowEditor = Ext.extend(Ext.Panel, { var g = this.grid, view = g.getView(), row = view.getRow(rowIndex), record = g.store.getAt(rowIndex); - + this.record = record; this.rowIndex = rowIndex; this.values = {}; @@ -193,10 +194,10 @@ Ext.ux.grid.RowEditor = Ext.extend(Ext.Panel, { this.fireEvent('canceledit', this, saveChanges === false); return; } - var changes = {}, - r = this.record, + var changes = {}, + r = this.record, hasChange = false, - cm = this.grid.colModel, + cm = this.grid.colModel, fields = this.items.items; for(var i = 0, len = cm.getColumnCount(); i < len; i++){ if(!cm.isHidden(i)){ @@ -225,7 +226,7 @@ Ext.ux.grid.RowEditor = Ext.extend(Ext.Panel, { verifyLayout: function(force){ if(this.el && (this.isVisible() || force === true)){ var row = this.grid.getView().getRow(this.rowIndex); - this.setSize(Ext.fly(row).getWidth(), Ext.fly(row).getHeight() + 9); + this.setSize(Ext.fly(row).getWidth(), Ext.isIE ? Ext.fly(row).getHeight() + 9 : undefined); var cm = this.grid.colModel, fields = this.items.items; for(var i = 0, len = cm.getColumnCount(); i < len; i++){ if(!cm.isHidden(i)){ @@ -373,7 +374,7 @@ Ext.ux.grid.RowEditor = Ext.extend(Ext.Panel, { scroll = view.scroller.dom.scrollLeft, bw = this.btns.getWidth(), width = Math.min(g.getWidth(), g.getColumnModel().getTotalWidth()); - + this.btns.el.shift({left: (width/2)-(bw/2)+scroll, top: h - 2, stopFx: true, duration:0.2}); } }, @@ -408,11 +409,11 @@ Ext.ux.grid.RowEditor = Ext.extend(Ext.Panel, { }, getTargetColumnIndex: function(pt){ - var grid = this.grid, + var grid = this.grid, v = grid.view, x = pt.left, cms = grid.colModel.config, - i = 0, + i = 0, match = false; for(var len = cms.length, c; c = cms[i]; i++){ if(!c.hidden){ @@ -485,7 +486,7 @@ Ext.ux.grid.RowEditor = Ext.extend(Ext.Panel, { top = parseInt(this.el.dom.style.top, 10), scroll = v.scroller.dom.scrollTop, h = this.el.getHeight(); - + if(top + h >= scroll){ t.initTarget(this.items.last().getEl()); if(!t.rendered){