首页 新闻 赞助 找找看

不显示删除回复显示所有回复显示星级回复显示得分回复 Extjs解析Json数据问题(“错误: 例外被抛出且未被接住”)

0
悬赏园豆:40 [已关闭问题] 关闭于 2011-08-16 08:30

mydata.json文件
 { "studies":[  
  { "UserName": "李彦宏", "Sex": "男", "Age":25, "XueHao":"00001", "BanJi":"一班" },  
  { "UserName": "马云", "Sex": "男", "Age":31, "XueHao":"00002", "BanJi":"二班" }]  
 }

grids文件

Ext.onReady(function () {
  Ext.define('MyData', {
  extend: 'Ext.data.Model',
  fields: ['UserName', 'Sex', 'Age', 'XueHao', 'BanJi']
  });

  //创建数据源 
  var data = new Ext.data.Store({
  model: 'MyData',
  proxy: {
  type: 'ajax',
  url: 'mydata.json',
   
  reader: {
  type: 'json',
  root: 'studies',
  totalProperty: 'totalCount' 
  }
  },
  autoLoad: true
  });

  Ext.create('Ext.grid.Panel', {
  store: data,
  columns: [
  { text: "姓名", width: 120, dataIndex: 'UserName', sortable: true },
  { text: "性别", flex: 1, dataIndex: 'Sex', sortable: false },
  { text: "年龄", width: 100, dataIndex: 'Age', sortable: true },
  { text: "学号", width: 100, dataIndex: 'XueHao', sortable: true },
  { text: "班级", width: 100, dataIndex: 'BanJi', sortable: true }
  ],
  height: 200,
  width: 600,
  x: 20,
  y: 20,
  title: 'ExtJS4 Grid示例',
  renderTo: Ext.getBody(),
  viewConfig: {
  stripeRows: true
  }
  });
});

小强斯基的主页 小强斯基 | 初学一级 | 园豆:150
提问于:2011-08-15 20:11
< >
分享
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册