Jump to content

Recommended Posts

Posted
    someFunction: function(listtable, successCallback){
        var thisfun= this;
        for (var i = 0; i < listtable.length; i++) {
            thisfun.clearTable(listtable[i], function () {
                console.log("table cleared");
                //call back here?????
            });
            thisfun.fillTable(listtable[i], function () {
                console.log("table filled");
               //call back here?????
            });
        }
    }
below is in different function:

thisapp.someFunction(listtable, function () {
        console.log("completed");
});

I want to get to console.log("completed") line when abv function completes the for loop and also the call back with in that cleartable and filltable. how to know when both the call backs of both cleartable and filltable are completed and then i want to get to comsole.log("completed"). how can i achieve this 

 

help mates pls

×
×
  • Create New...