dojo DataGrid使用一

dojo DataGrid使用(一)-----------通过html静态构建grid

<span style="font-family:Microsoft YaHei;font-size:14px;"><!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
</head>
<body>
 <style type="text/css">  

 @import "js/dojo/dojox/grid/resources/tundraGrid.css";  

 @import "js/dojo/dojo/resources/dojo.css";  

 </style>  
 <!-- <link rel="stylesheet" href="js/dojo/dojo/resources/dojo.css">
 <link rel="stylesheet" href="js/dojo/dijit/themes/claro/claro.css"> -->

 <script type="text/javascript" src="js/dojo/dojo/dojo.js" 

djConfig="parseOnLoad: true"></script>  

 <script type="text/javascript">  

 dojo.require("dojo.data.ItemFileReadStore");  

 dojo.require("dojox.grid.DataGrid");  

 var sampleData = {
         identifier: 'pro_no',
         label: 'pro_no',  
         items: [  
                   {pro_no:'2100', pro:'A Series', min_amount:346, max_amount:931, avg_amount:647},  
                   {pro_no:'2200', pro:'B Series', min_amount:301, max_amount:894, avg_amount:608},
                   {pro_no:'2300', pro:'C Series', min_amount:456, max_amount:791, avg_amount:532},  
                   {pro_no:'2400', pro:'D Series', min_amount:859, max_amount:2433, avg_amount:1840},  
                   {pro_no:'2500', pro:'E Series', min_amount:459, max_amount:1433, avg_amount:1040}  
                   ]
 };  

 var jsonStore = new dojo.data.ItemFileReadStore({ data: sampleData });  

 var layout = [  

 {field: 'pro_no', name: 'Product Number' },  

 {field: 'pro', name: 'Product' },  

 {field: 'min_amount', name: 'Minimum Amount' },  

 {field: 'max_amount', name: 'Maximum Amount' },  

 {field: 'avg_amount', name: 'Average Amount' }
 
 ];  

 </script>  

 </head>  

 <body class="tundra">  

 <div class="heading">First Grid</div>  

 <div id="grid" dojoType="dojox.grid.DataGrid" store="jsonStore"  structure="layout" autoWidth="true"></div>  

 </body>  

 </html>  </span>


  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值