Add an optional async parameter to sendRequest() to make simple async calls easier

This commit is contained in:
Nathan Gray 2013-09-10 20:22:47 +00:00
parent 36cfd70daa
commit 958167b0f7

View File

@ -66,7 +66,17 @@ egw.extend('json', egw.MODULE_WND_LOCAL, function(_app, _wnd) {
};
}
json_request.prototype.sendRequest = function() {
/**
* Sends the assembled request to the server
* @param {boolean} [async=false] Overrides async provided in constructor to give an easy way to make simple async requests
* @returns undefined
*/
json_request.prototype.sendRequest = function(async) {
if(typeof async != undefined)
{
this.async = async;
}
// Assemble the complete request
var request_obj = {
'json_data': this.egw.jsonEncode({