2
« on: July 23, 2014, 10:31:30 am »
Hi, i am trying to form my own data to send to the server by using getURL but i need to check permissions in others tables to establish the final data to send to the Grid , the problem is that getURL is not async and it always return url & data before my querys are finish , is there a way to override this function or modify to make getURL wait for my database response?
Or as alternative solution ... any ideas how i can perform some database calls before appending data to getURL?
Example :
getUrl: function (ui) {
var queryObj = {}
queryObj.pageNumber = ui.pageModel.curPage;
queryObj.nPerPage = ui.pageModel.rPP ;
queryObj.sortDir = ui.dataModel.sortDir;
queryObj.sortIndx = ui.dataModel.sortIndx;
var data = processPolicies(queryObj,function(data){
return { url: apiURL + "readCollection", data: data};
})
},
function processPolicies(queryObj,callback){
$.ajax(.......
success: callback(response);
}
Ty in Advance.