当前位置: 代码迷 >> JavaScript >> extjs 创办多个实例
  详细解决方案

extjs 创办多个实例

热度:208   发布时间:2012-10-07 17:28:51.0
extjs 创建多个实例

?

Ext.onReady(function() {
    var html = '<p>测试数据.</p>';
    
    var configs = [{
        title: 'Basic Panel',
        collapsible:true,
        width:400,
        html: html
    },{
        width: 320,
        height: 320,
        title: 'Masked Panel with a really long title',
        bodyStyle: "padding: 5px;",
        html: 'Some content',
      
    }];
    
    Ext.each(configs, function(config) {   //循环迭代 configs 
        var element = Ext.getBody().createChild({cls: 'panel-container'});//创建一个子窗口
        
        Ext.createWidget('panel', Ext.apply(config, {
            renderTo: element,
            bodyPadding: 7
        }));
    });
});
  相关解决方案