an interface for working with Promise objects
first = dhx.ajax("someA.php");
second = dhx.ajax("someB.php");
third = dhx.ajax("someC.php");
dhx.promise.all([first, second, third]).then(function(results){
var first_result = results[0];
var second_result = results[1];
var third_result = results[2];
// do something
...
});
dhx.promise constructor
var my_promise = new dhx.promise(function(success, fail){
dhx.ajax("some.php", function(text){
if (text) success(text);
else fail(text.error)
});
});
//realdata - data that came from server
my_promise.then(function(realdata){
...
});