.groupRequests() |
Groups a set of requests and sends them to the server as a single request. Using this function can speed up processing by reducing the total number of separate calls to the server. Possible calls within the handler that are asynchronous are ignored and sent synchronously. Returns the 'this' object. Syntax
The required handler is a function to call for which all the request are grouped into a single request. Options is a struct that can have the following items, all of which are optional. Caller is the calling object of the request. This is the object in the context of which the request must be executed. Async is a boolean that determines whether the operation is performed asynchronously. The default is true. Show-data is a boolean that determines whether or not any showdata events may be executed during the group request. The default is true. Success-function is a function called after the operation has successfully completed. Error-function is a function called if an error occurs.
NOTE 1: All actions are gathered and executed using a single Page Engine call. This means that you cannot use groupRequests() if one action depends on the result of a previous action. NOTE 2: To group $.udb().executeQuery() calls, you do not need to use groupRequests(). The same effect is achieved by calling the $.udb() function with the list of data sources to be queried: $.udb(["DEPT", "EMP"]).executeQuery();
Example $.udb.groupRequests(function(){ $.udb.executeSQLStatement('MySQL').executeSQLStatement('MySQLTwo').commit(); });
|