87,997
社区成员




var accordion = Ext.create('Ext.panel.Panel', {
width: '100%',
height: '100%',
layout:'accordion',
defaults: {
bodyStyle: 'padding: 0 0 0 20%',
}
});
var panel = Ext.create('Ext.panel.Panel', {
width: 1200,
height: '100%',
layout: "border",
listeners: {
beforerender: {
fn: function()
{
//accordion.add({xtype: 'panel', title: 'hello'});
Ext.Ajax.request({
url: 'news.js',
success: function(response){
var text = response.responseText;
var jsonResult = eval(text);
for(var i = 0; i < jsonResult.length; i+=1)
{
var panel = null;
panel = Ext.create('Ext.panel.Panel', {
title: jsonResult[i].title,
});
for(var j = 0; j < jsonResult[i].children.length; j+=1)
{
panel.add({
xtype: 'button',
height: 30,
width: 130,
margin: '10 0 0 0',
text: jsonResult[i].children[j].text,
clz: jsonResult[i].children[j].clz,
handler: createTab
})
}
accordion.add(panel);
}
accordion.hide().show();
}
});
}
}
},
renderTo: 'mainDiv',
items: [{
region: 'north',
height: 80,
html: 'Logo'
}, {
region: 'west',
title: '模块列表',
width: '20%',
// split: true,
collapsible: true,
items: [accordion]
}, {
region: 'center',
tbar: tabpanel,
}]
});