+ -
当前位置:首页 → 问答吧 → extjs girdpanel中的数据为何不显示?专家帮帮忙!

extjs girdpanel中的数据为何不显示?专家帮帮忙!

时间:2011-09-22

来源:互联网

Ext.define('S3.Console.HealthReport1', {
  constructor: function () {

  var startDate = Ext.create('Ext.form.field.Date', {
  fieldLabel: '开始时间',
  format: 'Y/m/d',
  editable: false,
  value: Ext.Date.add(new Date(), Ext.Date.DAY, -7),
  labelWidth: 80,
  width: 200
  });

  var endDate = Ext.create('Ext.form.field.Date', {
  fieldLabel: '结束时间',
  format: 'Y/m/d',
  editable: false,
  value: new Date(),
  labelWidth: 80,
  width: 200
  });

  var store = new Ext.data.JsonStore({
  root: 'data'
  });
  var grid = Ext.grid.GridPanel({
  height: 350,
  width: 600,
  data:store
  });
  var panel = Ext.create('Ext.panel.Panel', {
  width: 600,
  height: 500,
  layout: {
  type: 'fit',
  columns: 1
  },
  items: grid,
  buttons: [
  { text: '立即体检',
  width: 150,
  height: 50,
   
  handler: function () {

  Ext.Ajax.request({
  url: 'core/WebService.asmx/ColdStorage',
  headers: {
  'Content-Type': 'application/json; charset=utf-8'
  },
  method: 'POST',
  jsonData: {
  startTime: Ext.Date.format(startDate.getValue(), 'Y-m-d'),
  endTime: Ext.Date.format(endDate.getValue(), 'Y-m-d') + ' 23:59:59.999',
  dept_id: "0002"
  },
  success: function (response) {
  var responseJson = Ext.JSON.decode(response.responseText);
  store.loadData(responseJson);


  // Ext.Msg.alert("dsd");

   
  },
  failure: function () { Ext.Msg.alert("错误"); }

  });

  }
  }
  ]

  });
  var win = new Ext.create('Ext.Window', {
  title: '报表',
  height: 500,
  width: 600,
  layout: 'fit',
  tbar: [startDate, endDate],
  items: panel
  })

  win.show();
  }

});

作者: guo779820919   发布时间: 2011-09-22

是哪儿出错了吗?还是什么原因,谁知道呀!急着解决呀!

作者: guo779820919   发布时间: 2011-09-22

相关阅读 更多

热门下载

更多