Ext JS 3.4:如何在get post后获取表单's请求url
Ext JS 3.4: How to get form's request url after GET post
我在Ext JS 3.4中有一个表单:
function exportIE() {
//var date = new Date();
//Ext.getCmp('resolvedID').setValue(date);
// create the window on the first click and reuse on subsequent
// clicks
if (!winie) {
winie = new Ext.Window(
{
// applyTo:'hello-win',
id : 'ie-cl',
layout : 'fit',
width : 400,
height : 100,
closeAction : 'hide',
plain : true,
title : 'Export Individual User Issues to Excel',
items : ieform,
buttons : [
{
text : 'Submit',
handler : function() {
var url = "$baseUrl/plugins/servlet/timesheet/exportindividualtoexcel?project=$project&month=$month&year=$year&filtered=true";
if(ieform.getForm().isValid()){
winie.hide();
ieform
.getForm()
.submit(
{
waitMsg : 'Sending...',
url : url,
method: 'GET',
success : function(
response,
options) {
quickcreateform
.getForm()
.reset();
/*Ext.MessageBox
.alert(
'Success',
'Issue resloved');*/
//eraseCookie('timeout');
//eraseCookie('counter');
store.reload();
//storechart.loadData();
storechart.reload();
},
failure : function(
response,
options) {
/*Ext.MessageBox
.alert(
'Error',
'Unable to create issue');*/
//eraseCookie('timeout');
//eraseCookie('counter');
quickcreateform
.getForm()
.reset();
store.reload();
//storechart.loadData();
storechart.reload();
}
});
}
}
}, {
text : 'Close',
handler : function() {
ieform.getForm().reset();
//store.reload();
winie.hide();
}
} ]
});
}
winie.show(this);
}
所以这个表单是用来下载Apache POI MS Excel文件的,所以我需要把它添加到表单提交成功函数中:
document.location = request.url;
那么我该怎么做呢?
我需要那个URL也就是Submit GET URL
用于提交表单的URL可从提交中使用的Ext.form.Action
获得:
action.getUrl(true)
,其中true
参数表示它是一个GET case,因此表单参数需要追加到URL。详细信息请参见源代码。
action
对象可作为success
函数的第二个参数(如文档所述):
success: function(form, action) {
}
(注意,由于某种原因,您的代码将参数命名为response
和options
)。
getUrl(true)
。
根据上面我做了这个代码,现在它工作了:
var users = Ext.getCmp('select-user-combo').getValue();
document.location = options.getUrl(false)+"&users="+users;
相关文章:
- 如何从pdftron webviewer获取表单数据
- 如何从html页面中的表单获取值's变量
- 使用 jquery ajax 从 Bootstrap 3 模态表单获取数据
- JQuery & HTML:如何使用echo $_POST将数据从一个表单获取到另一个表单
- 将数据从表单获取到骨干中的集合
- Ajax/PHP 表单获取序列化选择值
- 从nodejs中的表单获取json文件内容
- 如何从html表单获取纬度经度值到谷歌地图
- 从表单获取值并显示消息的JavaScript
- 从HTML表单获取值
- 创建一个复杂的html5表单.获取动态表单数据.Id vs Name
- 流星表单获取带有动态名称的输入值
- Jquery表单获取默认值
- 只有在字段满足时才发送表单(获取)数据(不是验证)
- 为什么我得到这个错误时,试图从一个表单获取数据
- 在lotus notes中从另一个表单获取字段值,以便在web上执行验证
- Dojo表单获取值
- 将从 HTML 表单获取的值传递到位于单独.js脚本中的 TaffyDB 数据库中
- JavaScript 从联系表单获取访问者的先前 URL
- Javascript与HTML表单获取值