projects
/
Pman.Core
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
456fe31
)
Pman.Download.js
author
Alan Knowles
<alan@roojs.com>
Wed, 14 Aug 2019 07:44:36 +0000
(15:44 +0800)
committer
Alan Knowles
<alan@roojs.com>
Wed, 14 Aug 2019 07:44:36 +0000
(15:44 +0800)
Pman.Download.js
patch
|
blob
|
history
diff --git
a/Pman.Download.js
b/Pman.Download.js
index
5de6257
..
f4fda02
100644
(file)
--- a/
Pman.Download.js
+++ b/
Pman.Download.js
@@
-83,6
+83,8
@@
Pman.Download = function(cfg)
Roo.log("creating form?");
Roo.log("creating form?");
+ this.form = new FormData();
+ /*
var b = Roo.get(document.body);
this.form = b.createChild({
tag: 'form',
var b = Roo.get(document.body);
this.form = b.createChild({
tag: 'form',
@@
-91,6
+93,7
@@
Pman.Download = function(cfg)
target : this.newWindow ? '_new' : this.csvFrame.id,
enctype : 'multipart/form-data'
});
target : this.newWindow ? '_new' : this.csvFrame.id,
enctype : 'multipart/form-data'
});
+ **/
//
// if(this.doctype == 'pdf'){
// this.pdfEmbed = b.createChild({
//
// if(this.doctype == 'pdf'){
// this.pdfEmbed = b.createChild({
@@
-103,7
+106,8
@@
Pman.Download = function(cfg)
Roo.log(this.params);
for(var i in this.params) {
Roo.log(this.params);
for(var i in this.params) {
-
+ this.form.append(i, this.params[i]);
+ /*
var el = this.form.createChild( {
ns : 'html',
tag : 'input',
var el = this.form.createChild( {
ns : 'html',
tag : 'input',
@@
-112,16
+116,32
@@
Pman.Download = function(cfg)
name : i,
value : this.params[i]
});
name : i,
value : this.params[i]
});
+ */
+
+ }
+ var req = new XMLHttpRequest();
+ req.open(this.method, this.url);
+
+ var _t = this;
+ req.onload = function( ev )
+ {
+ if (req.status == 200) {
+ _t.success ? _t.sucess() : '';
+ } else {
+ _t.failure ? _t.failure() : '';
+ }
}
}
+ req.send(this.form);
+ /*
(function() {
this.submit = true;
this.form.dom.submit();
this.cleanup.defer(this.timeout || 30000,this);
}).defer(100, this);
(function() {
this.submit = true;
this.form.dom.submit();
this.cleanup.defer(this.timeout || 30000,this);
}).defer(100, this);
-
+ */
}
}
@@
-229,7
+249,7
@@
Roo.apply(Pman.Download.prototype, {
// private - clean up download elements.
cleanup :function()
{
// private - clean up download elements.
cleanup :function()
{
- Roo.log('cleanup?');
+
/*
Roo.log('cleanup?');
if (this.form) {
this.form.remove();
this.form= false;
if (this.form) {
this.form.remove();
this.form= false;
@@
-241,6
+261,7
@@
Roo.apply(Pman.Download.prototype, {
Roo.get(this.csvFrame).remove();
this.csvFrame= false;
}
Roo.get(this.csvFrame).remove();
this.csvFrame= false;
}
+ */
},
},