extjs - How to set layout to "fit" on an existing Ext.Panel? (.setLayout doesn't work) -


i define regioncontent here:

regioncontent = new ext.panel({     region: 'center',     // layout: 'fit', //used static, needs set dynamically     margins: '-1 0 0 -6',     autoscroll: true }); 

then later in page loaded via ajax, empty content of regioncontent , add new content it. @ time, how change layout "fit"?

when try use .setlayout('fit'), error layout.setcontainer not function:

<script type="text/javascript">     var start_info_panel = new ext.panel({         padding: 10,         width: 300,         html: '<h1>simple text page</h1><p>this example of page simple text.<p>'     });     replacecomponentcontent2(regioncontent, start_info_panel);      function replacecomponentcontent2(cmpparent, cmpcontent) {         clearextjscomponent(cmpparent);         cmpparent.add(cmpcontent);         cmpparent.setlayout('fit'); //error: "layout.setcontainer not function"         cmpparent.dolayout();     }      hidecomponent(regionhelp); </script> 

it appears using borderlayout within parent panel, , error may related following comment within .add() function of container type:

warning: containers directly managed borderlayout layout manager may not removed or added. see notes borderlayout more details.

more info

ext.container .add() docs

hope helps.


Comments

Popular posts from this blog

Add email recipient to all new Trac tickets -

400 Bad Request on Apache/PHP AddHandler wrapper -

php - Change action and image src url's with jQuery -