[TIMOB-13691] TiAPI: Ti.Network.HTTPClient ondatastream prototype doesn't fire
GitHub Issue | n/a |
---|---|
Type | New Feature |
Priority | Low |
Status | Open |
Resolution | Unresolved |
Affected Version/s | Release 3.1.0 |
Fix Version/s | n/a |
Components | Core |
Labels | api |
Reporter | Xiong Jun |
Assignee | Unknown |
Created | 2013-04-26T08:42:07.000+0000 |
Updated | 2018-02-28T20:03:21.000+0000 |
Description
When i using *Ti.Network.createHTTPClient* to create a *HTTPClient*, i wanna display upload progress on my app, the *ondatastream* event was bound like below:
var xhr = Ti.Network.createHTTPClient();
xhr.ondatastream = function(e){
// progressing...
};
but *ondatastream* event was never ever fired, i was confused by this condition, WTF...
finally, the solution is that you should only bind *ondatastream* like these:
var xhr = Ti.Network.createHTTPClient({
ondatastream: function(e){ ... }
});
that's really ridiculous, i guess your guys forgot to implement the prototype of *ondatastream* for HTTPClient(or something else like getter and setter of property *ondatastream*). can you fix it? we really wanna use it like:
var xhr = Ti.Network.createHTTPClient();
xhr.ondatastream = function(e){
// progressing...
};
{color:red}but not:{color}
var xhr = Ti.Network.createHTTPClient({
ondatastream: function(e){ ... }
});
regards && thx.
No comments