Alert icon
We're changing our privacy policy. This stuff matters.  Learn more  Dismiss

[ExtJs] RowEditor and autoHeight

Loading...

Sign in or sign up now!
Alert icon
Upgrade to the latest Flash Player for improved playback performance. Upgrade now or more info.
3,260
Loading...
Alert icon
Sign in or sign up now!
Alert icon

Uploaded by on Jul 2, 2009

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);
}
});

Category:

Science & Technology

Tags:

License:

Standard YouTube License

  • likes, 1 dislikes

Link to this comment:

Share to:

Uploader Comments (jtruffot)

  • 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

    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?

see all

All Comments (3)

Sign In or Sign Up now to post a comment!
  • Ok Thanks Pal, yep i have closeAction:'close', if i change to closeAction:'Hide', all the stuff in my form appears out of place, so i decided to use 'close', maybe this action destroy the editor, thanks for your support.

Loading...

Alert icon
0 / 00Unsaved Playlist Return to active list
    1. Your queue is empty. Add videos to your queue using this button:
      or sign in to load a different list.
    Loading...Loading...Saving...
    • Clear all videos from this list
    • Learn more