将数据发布到另一个页面 ExtJs
我正在尝试使用 POST 请求将数组发布到特定页面,目标页面生成一个 csv 并将我发送回流,现在我正在使用 ExtJs Ajax 类,但这不会像我需要的那样工作要发出普通的 HTTP 请求而不是 ajax,我当前的代码如下:
Ext.extend(Players.panel.Home,MODx.Panel,{
exportSubscribers: function(btn,e) {
MODx.Ajax.request({
url: Players.config.connectorUrl
,params: {
action: 'mgr/player/getSubscribers'
}
});
}
});
exportSubscribers 函数是从普通的 ExtJs 按钮执行的
{ xtype: 'button'
,text: 'Export Subscribers'
,preventRender: true
,handler: this.exportSubscribers
}
我应该使用什么类将其转换为普通请求?
谢谢。
I'm trying to post an array using a POST request to a specific page, the target page generates a csv and send me back the stream, right now i'm doing using ExtJs Ajax class, but that won't work as i need to make a normal HTTP request not ajax, my current code is as follows:
Ext.extend(Players.panel.Home,MODx.Panel,{
exportSubscribers: function(btn,e) {
MODx.Ajax.request({
url: Players.config.connectorUrl
,params: {
action: 'mgr/player/getSubscribers'
}
});
}
});
The exportSubscribers function is executed from a normal ExtJs button
{ xtype: 'button'
,text: 'Export Subscribers'
,preventRender: true
,handler: this.exportSubscribers
}
What class should i use to turn this into a normal request?
Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
没有类可以执行正常请求。我知道完成文件下载的两种方法:
.sumbit
方法来执行您想要的 POST 请求。Download CSV'
There isn't a class to do a normal request. I known two ways to accomplish a file download:
.sumbit
method from ExtJS button handler to do the POST request you want.<a href="url?params" title="Download CSV">Download CSV</a>'
您最好向服务器发出本地请求,然后在服务器端代码中向 CSV 源发出 cURL 请求。这样,您就可以创建一个非 XMLHttpRequest 方法来获取数据。
You'd be better off making a local request to your server, and then in your server-side code make a cURL request to the CSV source. That way, you can make a non XMLHttpRequest method to get your data.