日期:2014-05-16  浏览次数:20589 次

Extjs form加载问题
EXTjs 如何从grid行中跳转到另一个页面,自动加载form。

大家帮我看看我的代码有什么问题啊

js文件

form2 = new Ext.FormPanel( {
  // formId:'updateForm',
  labelWidth : 100,
  renderTo:'form-ct',  
  frame : true,
  title : 'Edit Data',
  labelAlign:'right',
  bodyStyle : 'padding:5px 5px 0',
  width : 400,
  waitMsgTarget : true,
  // configure how to read the json Data
  reader : new Ext.data.JsonReader({
  successProperty: 'success',
  root : 'itemVOList'  
  }, [
  {name: 'itemVO.campaignFrom', mapping:'campaignFrom'}, // custom mapping
  {name: 'itemVO.campaignTo', mapping:'campaignTo'},
  {name: 'itemVO.dateFrom', mapping:'dateFrom',dateFormat:'Y-m-d'},
  {name: 'itemVO.dateTo', mapping:'dateTo',dateFormat:'Y-m-d'},
  {name: 'itemVO.itemClass', mapping:'itemClass'},
  {name: 'itemVO.lineNumber', mapping:'lineNumber'},
  {name: 'itemVO.price', mapping:'price'},
  {name: 'itemVO.SKU', mapping:'SKU'},
  {name: 'itemVO.description', mapping:'description'}

  ]), 
  defaults : {
  width : 230
  },
  defaultType : 'textfield',
  items : [
  {
  fieldLabel : 'campaignFrom',
  name : 'itemVO.campaignFrom',
  text:'dddddddddd',
  allowBlank : false
  }, {
  fieldLabel : 'campaignTo',
  name : 'itemVO.campaignTo',
  allowBlank : false
  },{
  xtype: 'datefield',
  format: 'Y-m-d',
  name : 'itemVO.dateFrom',
  fieldLabel: 'Date From'
  },{
  xtype: 'datefield',
  format: 'Y-m-d',//format: 'Y-m-d H:i:s',
  name : 'itemVO.dateTo',
  fieldLabel: 'Date To'
  },{
  xtype: 'combo',
  name: 'itemVO.itemClass',
  fieldLabel: 'Item Class'  
  },{
  name: 'itemVO.lineNumber',
  fieldLabel: 'Line number' 
  },{
  name: 'itemVO.price',
  fieldLabel: 'price' 
  },
  {
  fieldLabel : 'SKU',
  name : 'itemVO.SKU'
  // allowBlank : false
  }, {
  xtype: 'textarea',
  fieldLabel : 'description',
  name : 'itemVO.description'
  // allowBlank : false
  }],

  buttons : [ {
  text : 'Submit Edit',
  disabled : false,
  handler : function() {
  // var _select = grid.getSelectionModel().getSelected();
  if (form2.form.isValid()) {
  form2.form.submit( {
 
  // url : 'updateEPSItem.action?itemVO.ID='+_select.get('itemVO.ID')+'',
  success : function(from, action) {
  Ext.Msg.alert('Edit Data Success', 'Edit Data Success!!');
  /