dynamic - Is calling doLayout() method a must after adding child to a parent? -


in our application, there tabpanel in adding/removing panel dynamically.

the panels added @ click of menu item following code in menu handler:

ext.getcmp('maintabpanelid').add(getpanel()); 

here getpanel() method returns panel after creating it.

assuming id of main tab panel maintabpanelid , of child panel panelid, in context, guide @ following:

  1. is necessary call dolayout() on maintabpanel after add method?
  2. should dolayout() called on maintabpanel or on newly added child panel, is, ext.getcmp('maintabid').dolayout() or ext.getcmp('panelid').dolayout()?
  3. will call dolayout() take care of issues related rendering, scrollbars esp.?
  4. the method getpanel() should return created panel (using ext.create) or should return config object (having xtype:'panel')? 1 should preferred better performance keeping time in mind?

abstractcontainer::add()

<...> if container configured size-managing layout manager, container recalculate internal layout @ time too.

so don't have 13 because:

abstractcontainer::dolayout()

<...> framework uses internally refresh layouts form cases.

abstractcontainer::defaults

for defaults work, child items must added using {xtype: ......} not using ext.create("widget.type",{}) © roger.spall

so i'd prefer return configuration object instead of components itself.


Comments

Popular posts from this blog

c# - SVN Error : "svnadmin: E205000: Too many arguments" -

c# - Copy ObservableCollection to another ObservableCollection -

All overlapping substrings matching a java regex -