总结2

Ext.onReady(function(){


/*alert("我是中国人!");

Ext.Msg.prompt('Name', 'Please enter your name:', function(btn, text){
          if (btn == 'ok'){
              // process text value and close...
          }
      });*/

var simpsonsStore = Ext.create('Ext.data.Store', {
   //storeId:'simpsonsStore',
   fields:['userName', 'target1', 'score1', 'target2', 'score2', 'target3', 'score3', 'target4', 'score4'],
   data:{'items':[
       { 'userName': 'Lisa',  "target1":"1",  "score1":"2",  "target2":"3",  "score2":"4",  "target3":"5",  "score3":"6",  "target4":"7",  "score4":"8"  },
       { 'userName': 'Bart',  "target1":"bart@simpsons.com",  "score1":"555-222-1234" },
       { 'userName': 'Homer', "target1":"home@simpsons.com",  "score1":"555-222-1244"  },
       { 'userName': 'Marge', "target1":"marge@simpsons.com", "score1":"555-222-1254"  }
   ]},
   proxy: {
       type: 'memory',
       reader: {
           type: 'json',
           root: 'items'
       }
   }
});

var myColumns = [{
    text: '一级领域',//这个就是合并的
               columns: [{
                   text     : '二级领域',
                   columns: [{
                   text     : '专家/准专家',
                   columns: [{
                   text     : '姓名' ,
                   dataIndex: 'userName'
               }]
               }]
               }]
    },{
    text: '操作系统',//这个就是合并的
               columns: [{
                   text     : 'windows',
                   columns: [{
                   text     : 'guanhuacheng',
                   columns: [{
                   text     : '目标' ,
                   dataIndex: 'target1'                    
               },{
                   text     : '现状' ,
                   dataIndex: 'score1'                    
               }]
               }]
               },{
                   text     : 'linux',
                   columns: [{
                   text     : 'guanhuacheng',
                   columns: [{
                   text     : '目标' ,
                   dataIndex: 'target2'                    
               },{
                   text     : '现状' ,
                   dataIndex: 'score2'                    
               }]                    
               }]
               }]
    },{
    text: '数据库',//这个就是合并的
               columns: [{
                   text     : '开源数据库',
                   columns: [{
                   text     : 'lipeng' ,
                   columns: [{
                   text     : '目标' ,
                   dataIndex: 'target3'                    
               },{
                   text     : '现状' ,
                   dataIndex: 'score3'                    
               }]                    
               }]
               },{
                   text     : '商业数据库',
                   columns: [{
                   text     : 'huziran',
                   columns: [{
                   text     : '目标' ,
                   dataIndex: 'target4'                    
               },{
                   text     : '现状' ,
                   dataIndex: 'score4'                    
               }]                    
               }]
               }]
    },{
    text: '操作系统',//这个就是合并的
               columns: [{
                   text     : 'windows',
                   columns: [{
                   text     : 'guanhuacheng',
                   columns: [{
                   text     : '目标' ,
                   dataIndex: 'target5'                    
               },{
                   text     : '现状' ,
                   dataIndex: 'score5'                    
               }]                    
               }]
               },{
                   text     : 'linux',
                   columns: [{
                   text     : 'guanhuacheng',
                   columns: [{
                   text     : '目标' ,
                   dataIndex: 'target6'                    
               },{
                   text     : '现状' ,
                   dataIndex: 'score6'                    
               }]                    
               }]
               }]
    },{
    text: '操作系统',//这个就是合并的
               columns: [{
                   text     : 'windows',
                   columns: [{
                   text     : 'guanhuacheng',
                   columns: [{
                   text     : '目标' ,
                   dataIndex: 'target7'                    
               },{
                   text     : '现状' ,
                   dataIndex: 'score7'                    
               }]                    
               }]
               },{
                   text     : 'linux',
                   columns: [{
                   text     : 'guanhuacheng',
                   columns: [{
                   text     : '目标' ,
                   dataIndex: 'target8'                    
               },{
                   text     : '现状' ,
                   dataIndex: 'score8'                    
               }]                    
               }]
               }]
    }];

var grid = Ext.create('Ext.grid.Panel', {
   title: 'Simpsons',
   //store: Ext.data.StoreManager.lookup('simpsonsStore'),
   store : simpsonsStore,
   border : "10 5 3 10",
   /*initComponent: function() {
       this.columns = [];
       this.callParent();
   },*/
   columns : myColumns,
   
   
   /*columns : [{
    text: '一级领域',//这个就是合并的
               columns: [{
                   text     : '二级领域',
                   columns: [{
                   text     : '专家/准专家',
                   columns: [{
                   text     : '姓名' ,
                   dataIndex: 'userName'
               }]
               }]
               }]
    },{
    text: '操作系统',//这个就是合并的
               columns: [{
                   text     : 'windows',
                   columns: [{
                   text     : 'guanhuacheng',
                   columns: [{
                   text     : '目标' ,
                   dataIndex: 'target1'                    
               },{
                   text     : '现状' ,
                   dataIndex: 'score1'                    
               }]
               }]
               },{
                   text     : 'linux',
                   columns: [{
                   text     : 'guanhuacheng',
                   columns: [{
                   text     : '目标' ,
                   dataIndex: 'target2'                    
               },{
                   text     : '现状' ,
                   dataIndex: 'score2'                    
               }]                    
               }]
               }]
    },{
    text: '数据库',//这个就是合并的
               columns: [{
                   text     : '开源数据库',
                   columns: [{
                   text     : 'lipeng' ,
                   columns: [{
                   text     : '目标' ,
                   dataIndex: 'target3'                    
               },{
                   text     : '现状' ,
                   dataIndex: 'score3'                    
               }]                    
               }]
               },{
                   text     : '商业数据库',
                   columns: [{
                   text     : 'huziran',
                   columns: [{
                   text     : '目标' ,
                   dataIndex: 'target4'                    
               },{
                   text     : '现状' ,
                   dataIndex: 'score4'                    
               }]                    
               }]
               }]
    },{
    text: '操作系统',//这个就是合并的
               columns: [{
                   text     : 'windows',
                   columns: [{
                   text     : 'guanhuacheng',
                   columns: [{
                   text     : '目标' ,
                   dataIndex: 'target5'                    
               },{
                   text     : '现状' ,
                   dataIndex: 'score5'                    
               }]                    
               }]
               },{
                   text     : 'linux',
                   columns: [{
                   text     : 'guanhuacheng',
                   columns: [{
                   text     : '目标' ,
                   dataIndex: 'target6'                    
               },{
                   text     : '现状' ,
                   dataIndex: 'score6'                    
               }]                    
               }]
               }]
    },{
    text: '操作系统',//这个就是合并的
               columns: [{
                   text     : 'windows',
                   columns: [{
                   text     : 'guanhuacheng',
                   columns: [{
                   text     : '目标' ,
                   dataIndex: 'target7'                    
               },{
                   text     : '现状' ,
                   dataIndex: 'score7'                    
               }]                    
               }]
               },{
                   text     : 'linux',
                   columns: [{
                   text     : 'guanhuacheng',
                   columns: [{
                   text     : '目标' ,
                   dataIndex: 'target8'                    
               },{
                   text     : '现状' ,
                   dataIndex: 'score8'                    
               }]                    
               }]
               }]
    }],*/
   height: 200,
   /*width: 2000,*/
   renderTo: Ext.getBody()
});
/*grid.reconfigure(simpsonsStore,myColumns);
grid.show(Ext.getBody());*/

});
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值