ExtJS FormPanel Only Rendered to Panel the First time it is Selected
My Form Panels need to be rendered based on a selection in an XML tree structure. However, my form panel for a specific node is only rendered the first time. When I change the selection to something else and return to the original selection, the form panel is not re-rendered.
It was rendering correctly based on the selection before when I had a simple Ext.Template and I did
var temp = Ext开发者_Python百科.getCmp('details-panel').body;
and then
(Ext.Template's name).overwrite(temp, node.attributes).
When I changed this overwrite line to
(Form Panel's name).render(temp), it only works the first time.
Any idea what I am missing? Thanks!
A component will only render once in ExtJS, after this you need to make use of doLayout() after adding and removing child components.
formPanel.doLayout();
I'm not sure I quite understand. I basically have
tp.getSelectionModel().on('selectionchange', function(tree, node){
var el = Ext.getCmp('temp-panel').body;
el.update("");
if(node && node.....){
myForm.render(el);
}
I want different form panels to show up based on which node I click on. So in the if (node && ...) block I need to render a specific formpanel everytime I switch my selection to this node. Right now it is only happening on the first time. Would calling myForm.doLayout() solve this issue?
精彩评论