Hi,
I currently having problem with using a component loader to load external page inside a Viewport, the problem is that the loaded component cannot be resized to fit the content height, so it left a hole in the bottom,
If i use non border layout, the form and the grid cannot be resized
here's the code details:
Main Page
Code:
Ext.onReady(function() {
Ext.create('Ext.container.Viewport', {
layout: 'border',
items: [
{
region: 'north',
autoHeight: true,
border: false,
margins: '0 0 5 0',
applyTo: 'header'
},{
region: 'west',
collapsible: false,
title: 'Navigation',
width: 200,
autoScroll: true,
split: true,
contentEl:'menu'
},{
region: 'center',
id: 'mainPanel'
}
]
});
var links = Ext.query('.menulink');
for(var i=0,len=links.length; i<len; i++) {
var link = Ext.get(links[i]);
link.on('click', function(evt) {
var href = this.dom.href;
var panel = Ext.create('Ext.Component',{
loader: {
url: href,
autoLoad: true,
scripts: true,
renderer: 'html',
failure: function() {
Ext.Msg.alert('Error, loading page failed');
}
}
});
var mainPanel = Ext.getCmp('mainPanel');
mainPanel.removeAll();
mainPanel.update('');
mainPanel.add(panel);
evt.preventDefault();
});
}
});
And the page is an HTML document, plus some ExtJS component on the child page
Code:
<h1>My Child Pages</h1>
<div id="content"></div>
<script type="text/javascript">
var grid = ...
var form = ...
Ext.create('Ext.container.Container', {
layout:'border',
height: 700, // this cannot be auto height
defaults:{split:true},
items: [grid, form],
renderTo: Ext.get('content')
});
</script>