Demo of a little hack for the RowEditor in Ext Js 3.0. It uses listeners and mutualise code in a resize method. See more about RowEditor at http://extjs.com/deploy/ext-3.0-rc2/examples/grid/row-editor.html .
Discuss about this problem on the ExtJs forum : http://www.extjs.com/forum/showthread.php?t=68879 .
new Ext.ux.RowEditor({
listeners: {
move: function(p){ this.resize(); },
hide: function(p){
var mainBody = this.grid.getView().mainBody;
var lastRow = Ext.fly(this.grid.getView().getRow(this.grid.getStore().getCount()-1));
mainBody.setHeight(lastRow.getBottom() - mainBody.getTop(),{
callback: function(){ mainBody.setHeight('auto'); }
});
},
afterlayout: function(container, layout) { this.resize(); }
},
resize: function() {
var row = Ext.fly(this.grid.getView().getRow(this.rowIndex)).getBottom();
var lastRow = Ext.fly(this.grid.getView().getRow(this.grid.getStore().getCount()-1)).getBottom();
var mainBody = this.grid.getView().mainBody;
var h = Ext.max([row + this.btns.getHeight() + 10, lastRow]) - mainBody.getTop();
mainBody.setHeight(h,true);
}
});
Hi Pal, i use RowEditor, but i have a problem, when i open my form for the firts time, my RowEditor operate so good, but if i close my form, and i open it again raised this:
The f is undefined,
F is undefined , is a bug from this line: fields = this.items.items
so if f is empty :
f = fields[i];
.
.
.
f.setValue(val); ////<—–Here Rise the bug.
Do ya know something about it ?Thank you
icebergdelphi 9 months ago
@icebergdelphi
Hi,
I never get this strange bug. The items of the RowEditor are the editors of each columns. One of this editors may be destroyed when you close your form?
jtruffot 9 months ago