
newTv.panel.Home = function(config) {
config = config || {};
Ext.apply(config,{
border: false
,bodyStyle: 'border: 1px solid red;'
,baseCls: 'modx-formpanel'
,renderTo: 'tv'+config.tv+'-panel'
,items:[{
xtype: 'panel'
,layout: 'column'
,anchor: '100%'
,bodyStyle: 'border: 1px solid blue;'
,items: [{
xtype: 'panel'
,layout: 'form'
,columnWidth: .5
,bodyStyle: 'border: 1px solid green;'
,items: [{
xtype: 'textfield'
}]
},{
xtype: 'panel'
,layout: 'form'
,columnWidth: .5
,bodyStyle: 'border: 1px solid green;'
,items: [{
xtype: 'textfield'
}]
}]
}]
});
newTv.panel.Home.superclass.constructor.call(this,config);
};
Ext.extend(newTv.panel.Home,MODx.Panel);
Ext.reg('newtv-panel',newTv.panel.Home);
This question has been answered by multiple community members. See the first response.
But if i get the max width there is still the problem with resizing your browser.
If i have a Ext.Panel inside a CMP i can set the anchor to 100% and it resizes when you resizing your browser.
If i have the width for example 1536px and i set the width to that. When i resize the width still being the same.
/* fix layout when MODX's left bar is collapsed/expanded */
var modxLeftBar = Ext.getCmp('modx-leftbar-tabs');
var myCustomTv = Ext.getCmp('my-custom-tv-name');
if (modxLeftBar) {
modxLeftBar.on('collapse', function(){
myCustomTv.doLayout();
});
modxLeftBar.on('expand', function(){
myCustomTv.doLayout();
});
modxLeftBar.on('afterlayout', function(){
myCustomTv.doLayout();
});
}Maybe tv container has layout different from 'anchor'. Your newTv.panel.Home should also has layout: 'anchor'. It seems that renderTo breaks such things as anchoring.
Quote from: wiegers at Dec 06, 2012, 04:11 AMBut if i get the max width there is still the problem with resizing your browser.
If i have a Ext.Panel inside a CMP i can set the anchor to 100% and it resizes when you resizing your browser.
If i have the width for example 1536px and i set the width to that. When i resize the width still being the same.
try this:
/* fix layout when MODX's left bar is collapsed/expanded */ var modxLeftBar = Ext.getCmp('modx-leftbar-tabs'); var myCustomTv = Ext.getCmp('my-custom-tv-name'); if (modxLeftBar) { modxLeftBar.on('collapse', function(){ myCustomTv.doLayout(); }); modxLeftBar.on('expand', function(){ myCustomTv.doLayout(); }); modxLeftBar.on('afterlayout', function(){ myCustomTv.doLayout(); }); }
xtype:'container' ,layout:'fit' ,style: 'position:relative !important;'
layout: 'hbox'
//or
layout: { type: 'hbox', align: 'stretch' }Sometime change xtype of parent to 'container' or 'fieldset' solve the problem. Or add another parent
xtype:'container' ,layout:'fit' ,style: 'position:relative !important;'
If it did not solve the problem, change the parent's layout to 'hbox'.
layout: 'hbox' //or layout: { type: 'hbox', align: 'stretch' }
It's all about style or css, and your tv was overridden by the upper layout. Using firefox with WebDeveloper addon should help to get the generated html source.