Check documentation for the latest version 6.0 of dhtmlxSuite promise DHTMLX Docs

promise

an interface for working with Promise objects

object promise;

Example

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
    ...
});

Details

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){
    ...
});
See also
Back to top