Ext 构建gridtree的步骤

  1. Ext 构建gridtree的步骤

  2. Ext.require([  
  3.     'Ext.data.*',  
  4.     'Ext.grid.*',  
  5.     'Ext.tree.*'  
  6. ]);  
  7.   
  8. Ext.onReady(function() {  
  9.     //we want to setup a model and store instead of using dataUrl  
  10.     Ext.define('strSiteName', {  
  11.         extend: 'Ext.data.Model',  
  12.         fields: [  
  13.              
  14.             {name: 'strSiteName',     type: 'string'},  
  15.             {name: 'flaSiteScore', type: 'double'},  
  16.             {name: 'flaInfoDisclosureScore',     type: 'double'},  
  17.             {name: 'flaOnlineServicesScore',     type: 'double'},  
  18.             {name: 'flaPublicParticipationSore', type: 'double'},  
  19.             {name: 'flaWebDesignScore', type: 'double'},  
  20.             {name: 'flaDailyScore', type: 'double'}          
  21.                       
  22.         ]  
  23.     });  
  24.           
  25.     var store = Ext.create('Ext.data.TreeStore', {  
  26.         model: 'strSiteName',  
  27.         proxy: {  
  28.             type: 'ajax',  
  29.             //the store will get the content from the .json file  
  30.             url: 'treegrid.json'  
  31.         },  
  32.         folderSort: true  
  33.     });  
  34.   
  35.     //Ext.ux.tree.TreeGrid is no longer a Ux. You can simply use a tree.TreePanel  
  36.     var tree = Ext.create('Ext.tree.Panel', {  
  37.         title: 'Duration',  
  38.         width: 800,  
  39.         height: 300,  
  40.         renderTo: Ext.getBody(),  
  41.         collapsible: true,  
  42.         useArrows: true,  
  43.         rootVisible: false,  
  44.         store: store,  
  45.         multiSelect: true,  
  46.         singleExpand: false,  
  47.         //the 'columns' property is now 'headers'  
  48.         columns: [{  
  49.             xtype: 'treecolumn'//this is so we know which column will show the tree  
  50.             text: '网站名称',  
  51.             flex: 8,  
  52.               
  53.             sortable: true,  
  54.             dataIndex: 'strSiteName'  
  55.         },{  
  56.               
  57.             text: '总分',  
  58.             flex: 5,  
  59.             sortable: true,  
  60.             dataIndex: 'flaSiteScore'  
  61.         },{  
  62.               
  63.             text: '公开',  
  64.             flex: 5,  
  65.             sortable: true,  
  66.             dataIndex: 'flaInfoDisclosureScore'  
  67.         },{  
  68.               
  69.             text: '在线办事',  
  70.             flex: 5,  
  71.             sortable: true,  
  72.             dataIndex: 'flaOnlineServicesScore'  
  73.         },{  
  74.               
  75.             text: '公众参与',  
  76.             flex: 5,  
  77.             sortable: true,  
  78.             dataIndex: 'flaPublicParticipationSore'  
  79.         },{  
  80.               
  81.             text: '网站性能及设计',  
  82.             flex: 5,  
  83.             sortable: true,  
  84.             dataIndex: 'flaWebDesignScore'  
  85.         },{  
  86.               
  87.             text: '日常保障',  
  88.             flex: 5,  
  89.             sortable: true,  
  90.             dataIndex: 'flaDailyScore'  
  91.         }   ]  
  92.     });  
  93. });  
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值