I am calling telerik Grid's grid.submitchanges()(FUNCTION1) in javascript which is an async call and there is one ajax synchronous callback (FUNCTION2) after FUNCTION1.
The problem is sometimes FUNCTION2 is getting executed before the completion of FUNCTION1 as FUNCTION1 is Async call.
But I need FUNCTION2 to execute only after completion of FUNCTION1.
So Is there any way to get callback for telerik grid submitChanges(FUNCTION1)? or Can I make telerik grid submitChanges(FUNCTION1) a sync call?
Code-:
//FUNCTION 1
if (grid != undefined && grid.hasChanges()) {
grid.submitChanges();
}
//FUNCTION 2
$.ajax({
url: urlForTheController,
type: 'GET',
async: false,
cache: false,
data: { TotalConAssociation: noOfRows },
success: function (data) {
$('#AssociationWithDocument').data('tWindow').close();
showConcepts(currentConceptIndex);
},