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"}试了半天只是单纯的执行回调,不知道怎么接受返回值
解决方案 »
- 单击在table中某一行按钮,怎么获得改行的数据?
- 用GOOGLE浏览器查看别人的网页JS代码,怎么出来的是乱码啊?在线等答案
- window.open(url,name)用同一个name还是会打开多个窗口,而不是重用同一个。
- 像表格格式Div列表,单击一行后,如何取得第一行第一列ID的值并使该行底色变成红色,见内容说明。
- 如何屏蔽掉按住shift键的新打开窗口,马上给分!
- 按照资料上面正则表达式写的检测为什么报错:验证一个ID 号码是否由一个2位数字,一个连字符以及一个5位数字组成。
- 巨难的问题!!!!!!!!如何在同一个IE中的不同html文件中传递参数?
- 关于网页内容的问题
- 点击下载的问题
- javascript:void(0)的含义?
- 封装自己的js提示信息jtip办法
- javascript代码触发keydown 事件后,如何给event.keycode赋值
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('提示', '添加失败!');
}
});
Ext.getCmp("MyBank").store.proxy = new Ext.data.HttpProxy({ url: "/**/**" });
Ext.getCmp("MyBank").store.load();
//这里能否接受到返回的json
}
success: function(){
//这里能否接受到返回的json
}, there are 2 params in this fuction -- form and action,you can get your returned json data in action param.
为什么Ext.getCmp("mygrid").store.load();提示为空或不是对象呢
你抱的是那个?
然后在页面操作json
Action:
//result是一个对象,可以设置result.jsonStr = 你的json
out.println(JSONObject.fromObject(result).toString());jsp:
//success这个方法是有参数的
success : function(form, action) {
Ext.Msg.alert('提示', action.result.jsonStr);
}
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
});
{
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
}]}]
alert(resonse.result)
}