Force layout of fieldset ExtJs4?
In ExtJs3 I was able to use the fieldsets config property forceLayout
.开发者_StackOverflow中文版 To force the fieldset to layout its items even when collapsed or hidden.
It doesn't appear that there is a way to do this via component configuration any more. The reason is probably that in ExtJS 3 form fields had to be rendered into the DOM in order to have their values submitted along with the form. However one of the improvements in ExtJS 4 was that form fields are no longer tied to the DOM, so they don't have to be rendered in order to get submitted (as long as you use the ExtJS form API to submit the form.) Therefore the forceLayout configuration shouldn't be necessary.
If you really need to force rendering for some reason, you could try doing something like:
var fieldset = new Ext.form.FieldSet({
renderTo: 'parent',
collapsed: true,
//...other configs
});
fieldset.getLayout().renderItems(); //force rendering of sub-items
精彩评论