PDA

View Full Version : Force Rerender of child components of Ext.form.Panel.



imnilesh
25 Jun 2013, 4:03 AM
I am using Ext.form.Panel as my container and it contains form fields as child items.

After first rendering, on some external event I want to change rendering templates of form fields and rerender the form again. But I am not able to do so.

I looked upon doLayout() it doesn't seems to rerender the child components again.

If I remember correctly, in ExtJs 3.x, there was something like: view.refresh() which rerendered the views.
In ExtJs 4.2, how can I force the form panel to re-render it's child components?

Thanks in advance.

imnilesh
26 Jun 2013, 12:04 AM
I am finding it hard to find a way other than reloading the whole form again which would lead one more server trip :(

slemmon
26 Jun 2013, 8:56 PM
There's not a way to force the components to re-render. You can have them perform repeat layouts, but re-render. Why are you needing them to render a second time?

imnilesh
26 Jun 2013, 9:16 PM
Thanks Slemmon for the reply.

I am trying to put a feature wherein you can toggle between edit view and non-editable view.
Mostly there would be a button/menu on Ext.form.Panel by which you can toggle.

For that functionality, I am trying to modify rendering templates and hence want a forceful re-render.

Is there any other way to do above functionality or forceful re-render?

slemmon
27 Jun 2013, 12:19 PM
If you're looking to allow the user to switch between two views what about using a card layout with deferredRender: false and have your two views effectively be overlapping views of one another - each affected by the other when edited?

imnilesh
27 Jun 2013, 10:28 PM
Yes I will try the card layout approach. Thanks.

imnilesh
3 Jul 2013, 4:23 AM
I tried with the CARD layout.
But then, I need to put 2 items(one with Edit mode, other with non-edit mode) which means 2 objects. :(