PDA

View Full Version : How do I close a nested form column?



jcwatson11
13 Oct 2007, 10:33 AM
In developing with this awesome framework, I came across the fact that the form.end() function closes all open columns and fieldsets.

I'm using form.column() and form.fieldset() to create new columns and fieldsets on the fly.

For example, if I open a new fieldset, and want 3 columns in it, I would imagine that I should do a form.fieldset() (leaving it open) and then do 3 consecutive form.columns() with their respective close function for each column. Unfortunately, the only method I can find that closes a column (form.end()) sets the current container back to form.root, which closes everything (including the fieldset that I want to remain open).

I imagine I could use Ext.override to create a new form method that ends only the current container. But, since I see a pattern of spending several hours of development only to find out that Jack and the Ext development team already thought of it and I could have been done in a single line of code, I thought I should post the question here to see if anyone else could think of a better way.

Animal
13 Oct 2007, 10:34 PM
form.end() is correct. It pops the currently active form subcontainer off a stack and goes back to the outer one. It does not drop straight back to the Form:



end : function(){
if(this.active == this.root){
return this;
}
this.active = this.active.ownerCt;
return this;
},


the active property is now the active property's owner container.

jcwatson11
13 Oct 2007, 11:32 PM
Hi Animal,

For some reason it didn't work for me the first time I tried it. But it's working fine now. I was probably doing something wrong the first time.

Thanks for the quick response! You guys are the best!

Jon