Note that there are some explanatory texts on larger screens.

plurals
  1. POExt.Ajax.request callbacks never called when isUpload is true
    primarykey
    data
    text
    <p>I'm using ExtJS to make a form that generates a report from the data in the database in CSV format. After the user chooses a simple range of dates to extract the data and submits, running the following code :</p> <pre><code>var frm = document.createElement('form'); frm.id = 'frmDummy'; frm.name = id; document.body.appendChild(frm); Ext.MessageBox.wait('Generating CSV File ...'); Ext.Ajax.request({ url: 'csv_extract_ajax.php?start_time='+txtDateFieldFrom.getRawValue()+'&amp;end_time='+txtDateFieldTo.getRawValue(), method : 'POST', form: Ext.fly('frmDummy'), isUpload: true, success: function(o, r, n){ Ext.MessageBox.updateProgress(1); Ext.MessageBox.hide(); }, failure: function(o, r, n){ Ext.MessageBox.updateProgress(1); Ext.MessageBox.hide(); }, callback: function(o, r, n){ Ext.MessageBox.updateProgress(1); Ext.MessageBox.hide(); }, scope: this }); </code></pre> <p>The associated php file simple outputs a CSV string, working file.</p> <p>Since the isUpload is true, it seems that the callback is never returned to the user. As soon as I remove it, the callback is called but the file is not uploaded to the client. </p> <p>The problem now, everything is working perfectly but the MessageBox never disappears since the callbacks are never called (success, failure or callback)</p> <p>Any idea ? :P</p> <p><strong>Additional info:</strong></p> <p>PHP header :</p> <pre><code>header("Pragma: public"); header("Expires: 0"); header("Cache-Control: private"); header("Content-type: application/octet-stream"); header("Content-Disposition: attachment; filename=$filename"); header("Accept-Ranges: bytes"); </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload