请前辈帮我看下面Extjs代码 有什么问题?先谢过~~

JavaOlder 发布于 2013/01/30 11:27
阅读 91
收藏 0
Ext.onReady(function(){

var store = new Ext.data.Store({
		data:[
			   [
					1,
					"Office Space",
					"Mike Judge",
					"1999-02-19",
					1,
					"Work Sucks",
					"19.95",
					1
				],[
					3,
					"Super Troopers",
					"Jay Chandrasehar",
					"2002-02-15",
					1,
					"Altered State Police",
					"14.95",
					1
				]
		    ],

		reader:new Ext.data.ArrayReader(
		
		{id:'id'},
			[
				'id',
				'title',
				'director',
				{name:'released',type:'date',dateFormat:'Y-m-d'},
				'genre',
				'tagline',
				'price',
				'available'
			]
		)
	});
});
加载中
0
JavaOlder
JavaOlder
<!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">
<link rel ="stylesheet" type="text/css" href="../extjs/resources/css/ext-all.css"/>
<script type="text/javascript" src="../extjs/adapter/ext/ext-base.js"></script>
<script type="text/javascript" src="../extjs/ext-all.js"></script>
<script type="text/javascript">
Ext.onReady(function(){
 var myData = [
       [
      1,
      "Office Space",
      "Mike Judge",
      "1999-02-19",
      1,
      "Work Sucks",
      "19.95",
      1
     ],[
      3,
      "Super Troopers",
      "Jay Chandrasehar",
      "2002-02-15",
      1,
      "Altered State Police",
      "14.95",
      1
     ]
    ]
 var store = Ext.create('Ext.data.ArrayStore', {
        fields: [
     {name: 'id'},
           {name: 'title'},
           {name: 'director'},
           {name: 'released', type: 'date', dateFormat: 'Y-d-m'},
     {name: 'genre', },
           {name: 'tagline'},
     {name: 'price', },
     {name: 'uid', },
   ],
        data: myData
    });
 
 //add  your   data  store here  
 var grid  =  new  Ext.grid.GridPanel({  
    renderTo:  document.body,  
    frame:true,  
    title:  'Movie   Database', 
    height:200,  
    width:500, 
    store: store, 
    columns:  [ 
      {header:  "Title",  dataIndex: 'title'},   
      {header:  "Director",  dataIndex: 'director'},  
      {header:  "Released",  dataIndex: 'released', 
      renderer:  Ext.util.Format.dateRenderer('m/d/Y')}, 
      {header:  "Genre",  dataIndex:  'genre'},  
      {header:  "Tagline",   dataIndex:  'tagline'}  
    ] 
   });
});
</script>
<title>EXTJS</title>
</head>
<body>

</body>
</html>

 

JavaOlder
JavaOlder
换了一种方式搞定~
返回顶部
顶部