Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <script type="text/javascript">
- Ext.onReady(function () {
- Ext.state.Manager.setProvider(new Ext.state.CookieProvider());
- var viewport = new Ext.Viewport({
- layout: 'border',
- items: [{
- region: 'west',
- id: 'west-panel',
- title: 'West',
- split: true,
- width: 200,
- minSize: 175,
- maxSize: 400,
- collapsible: true,
- margins: '0 0 0 5',
- layout: 'accordion',
- layoutConfig: {
- animate: true
- },
- contentEl: 'divMenu'
- },
- new Ext.Panel({
- region: 'center',
- id: 'mainPanel',
- layout: 'fit',
- html: ''
- })
- ]
- });
- });
- function addItem() {
- var anagPanel = new Ext.Panel({
- layout: 'border',
- items: [{
- region: 'north',
- html: 'North',
- margins: '5 5 0 5',
- bodyStyle: 'padding:10px;',
- split: true,
- html: 'Some content'
- }, {
- plain: true,
- region: 'center',
- html: 'center'
- }]
- });
- }
- // the above code removes all existing panel and child items/containers
- // just remove the whole if block if you don't want to remove any existing child containers
- if(Ext.getCmp('mainPanel').items != undefined){
- Ext.getCmp('mainPanel').items.each(function(item){
- Ext.getCmp('mainPanel').remove(item, true);
- });
- }
- // following code is adding an extra panel
- Ext.getCmp('mainPanel').add(anagPanel);
- Ext.getCmp('mainPanel').doLayout();
- }
- </script>
- </head>
- <body>
- <script type="text/javascript" src="../shared/examples.js"></script><!-- EXAMPLES -->
- <div id="testPanel" style="border:1px solid aqua;height:0px;display:none;">
- <table style="border:1px solid red;width:100%;">
- <tr>
- <td>ciccio</td>
- </tr>
- </table>
- </div>
- <div id="divMenu">
- <a onclick="javascript:addItem()" href="#">add item</a>
- </div>
Add Comment
Please, Sign In to add comment