var formUpload = new Ext.form.FormPanel({
baseCls: 'x-plain',
labelWidth: 80,
fileUpload:true,
defaultType: 'textfield',
items: [{
  xtype: 'textfield',
  fieldLabel: '文 件',
  name: 'upload',
  inputType: 'file',
  allowBlank: false,   
  blankText: '请导入文件',
  anchor: '90%'  // anchor width by percentage   
}]
});
var upload_left = new Ext.Panel({
labelAlign: 'left',
title: '源报表',
labelWidth: 50,   
frame: true,                           
width: 440,                            
items: [formUpload],
buttons: [{   
text: '导入',
handler: function() {
if(formUpload.form.isValid()){   
Ext.MessageBox.show({   
title: '导入中',   
msg: '请稍等...',   
progressText: '',   
width:300,   
progress:true,   
closable:false,   
animEl: 'loding'  
});
formUpload.getForm().submit({
url:'Ext1.php',
method: 'GET',
success: function(){
//这里能否接受到返回的json
},       
failure: function(){       
Ext.Msg.alert('Error', 'Error'); 
}   
});             
}   
}   
}]
Ext1.php的返回值 {"success":"OK"}试了半天只是单纯的执行回调,不知道怎么接受返回值

解决方案 »

  1.   

    什么意思?你要接一个JSON给某个GRIE或CBO赋值?
      

  2.   

     Ext.getCmp("Bank").getForm().submit({
                waitMsg: '正在提交数据',
                waitTitle: '提示',
                url: '/Finance/Bank',
                method: 'POST',
                success: function(form, action) {
                    Ext.Msg.alert('提示', '添加成功!');
                    Ext.getCmp("MyBank").store.proxy = new Ext.data.HttpProxy({ url: "/Finance/GetMyBank" });
                    Ext.getCmp("MyBank").store.load();
                },
                failure: function(form, action) {
                    Ext.Msg.alert('提示', '添加失败!');
                }
            });
      

  3.   

     success: function(){直接赋值就好
      Ext.getCmp("MyBank").store.proxy = new Ext.data.HttpProxy({ url: "/**/**" });
      Ext.getCmp("MyBank").store.load();
                                //这里能否接受到返回的json
                            }
      

  4.   

     
             success: function(){
                           //这里能否接受到返回的json
                            },       there are 2 params in this fuction -- form and action,you can get your returned json data in action param.
      

  5.   

    我的grid里已经定义了id:"mygrid"
    为什么Ext.getCmp("mygrid").store.load();提示为空或不是对象呢
      

  6.   

    是同一页,会不会是store为空?
      

  7.   

    你把grid 写完整了 我估摸着就好了
      

  8.   

    this.proxy 为空 我记得是没store啊
    你抱的是那个?
      

  9.   

    你可以返回一个json或者xml
    然后在页面操作json
    Action:
    //result是一个对象,可以设置result.jsonStr = 你的json
    out.println(JSONObject.fromObject(result).toString());jsp:
    //success这个方法是有参数的
    success : function(form, action) {
        Ext.Msg.alert('提示', action.result.jsonStr);
    }
      

  10.   

    我的grid是这么写的
    var grid = new Ext.grid.GridPanel({
    id:"mygrid",
    autoScroll:true,
    columns: [
    {header: "appeId", width: 60, dataIndex: 'appeId', sortable: true},
    {header: "survId", width: 60, dataIndex: 'survId', sortable: true},
    {header: "location", width: 60, dataIndex: 'location', sortable: true},
    {header: "surveyDate", width: 100, dataIndex: 'surveyDate', sortable: true},
    {header: "surveyTime", width: 100, dataIndex: 'surveyTime', sortable: true},
    {header: "inputUserId", width:80, dataIndex: 'inputUserId', sortable: true},
    {header: "modifyTime", width:80, dataIndex: 'modifyTime', sortable: true}
    ],
    stripeRows: true,
    bodyStyle:'width:100%',
    height: 490
    });
      

  11.   

    items: [
    {
        xtype: "grid",
        title: "",
        id: "My",
        width: 1028,
        store: {
            xtype: "jsonstore",
            autoLoad: true,
            url: " ",
            fields: [
    '****' ]
        },
        height: 496,
        columns: [
        {
            header: "",
            sortable: true,
            resizable: true,
            dataIndex: "****",
            width: 96
        }]}]
      

  12.   

    success:function(form,response){
         alert(resonse.result)
    }
      

  13.   

    那这个返回的json怎么放入grid里