+ -
当前位置:首页 → 问答吧 → EXT CheckboxGroup 动态绑定数据问题

EXT CheckboxGroup 动态绑定数据问题

时间:2011-01-24

来源:互联网

代码如下:
var data; 
 var itemsGroup = new Ext.form.CheckboxGroup({
  xtype: 'checkboxgroup',
  hideLabel: true,
  name: 'items',
  width: 360,
  columns: 1,
  items:data
  });  
var FormField = new Ext.form.FormPanel({
  title: '石油授权',
  width: 200,
  bodyStyle: 'padding:20px;',
  renderTo: 'DivOil',
  items: itemsGroup
  });
function GetFieldList(DepName, FieldType) {
  Ext.Ajax.request({
  method: 'post',
  url: "DepFieldbPriorty.aspx",
  params: { Method: "GetFieldList", DepName: DepName, FieldType: FieldType },
  success: function someFn(response, request) {
  var obj = Ext.decode(response.responseText);
  data= obj;
  alert(response.responseText);
  }
  });
  }
  GetFieldList("科室", "石油");
错误提示:Microsoft JScript 运行时错误: 'this.items.0' 为空或不是对象。
后台返回数据[{ boxLabel: '合水', checked: true }, { boxLabel: '镇北', checked: true }, { boxLabel: '环江', checked: true }]
我将后台返回的数据在一开始直接赋值给data,就可以正常显示。不知道为什么?

作者: fengqingyuejiao   发布时间: 2011-01-24

怎么没有人回答呢

作者: fengqingyuejiao   发布时间: 2011-01-25

热门下载

更多