首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > JavaScript >

求诸位看看,刚学extjs

2013-07-11 
求各位看看,刚学extjs这段代码怎么不显示grid里的数据 啊,求解答Ext.onReady(function(){ Ext.QuickTips.i

求各位看看,刚学extjs
这段代码怎么不显示grid里的数据 啊,求解答
Ext.onReady(function(){
 Ext.QuickTips.init();
 var myStore = Ext.create('Ext.data.ArrayStore',{
 fields:['name','age','email'],
 data:[
 ['aa',3,'aa@sina'],
 ['bb',1,'bb@163'],
 ['cc',3,'cc@126'],
 ['dd',2,'dd@qq'],
 ['ee',4,'ee@yahoo']
 ]
 //autoLoad:true
 });
 var grid = Ext.create("Ext.grid.Panel",{
 title : 'GridDemo',
 store : myStore,
 columns : [
 {text: 'Name'},
 {text: 'Age'},
 {text: 'Email'}
 ],
 width:500,
 height:400,
 renderTo :Ext.getBody()
 });
 })
[解决办法]
这样也可以:
 columns : [
  {text:'名称',dataIndex: 'name'},
  {text:'年龄' ,dataIndex:'age'},
  {text:'邮件', dataIndex:'email'}
  ],
[解决办法]
数据索引,就是映射数据源的字段

热点排行
Bad Request.