Hi ,
Below is my code
I want to execute second method only after first method finshes ,
but here .. seond method gets called in between and then executing first and then second .happening something strange
viewModelDocCall.ReportCall = function () {
if (isConnectionAvailable()) {
callData.GetAvailableCoOrdinates(true, viewModelDocCall.customerLocationID(), function (tx, coOrdinates) {
if (null != coOrdinates && coOrdinates.rows.length > 0) {
if (!(validator.IsNullOrWhiteSpace(coOrdinates.rows.item(0).Latitude)) ||
!(validator.IsNullOrWhiteSpace(coOrdinates.rows.item(0).Longitude))) {
var result = DevExpress.ui.dialog.confirm(Messagehandling.getMessage('AP067', 'Are you currently at the meeting location?'), Common.Localize("Delete"));
result.done(function (dialogResult) {
if (dialogResult) {
dCall_GetCoOrdinatesClicked();
}
});
}
}
}, function (tx, coOrdinatesError) {
});
}
}
What I have tried:
viewModelDocCall.ReportCall = function () {
if (isConnectionAvailable()) {
callData.GetAvailableCoOrdinates(true, viewModelDocCall.customerLocationID(), function (tx, coOrdinates) {
if (null != coOrdinates && coOrdinates.rows.length > 0) {
if (!(validator.IsNullOrWhiteSpace(coOrdinates.rows.item(0).Latitude)) ||
!(validator.IsNullOrWhiteSpace(coOrdinates.rows.item(0).Longitude))) {
var result = DevExpress.ui.dialog.confirm(Messagehandling.getMessage('AP067', 'Are you currently at the meeting location?'), Common.Localize("Delete"));
result.done(function (dialogResult) {
if (dialogResult) {
dCall_GetCoOrdinatesClicked();
}
});
}
}
}, function (tx, coOrdinatesError) {
});
}
alert("Called second method")
}