BX.ajax.runAction
BX.ajax.runAction(action[, config])
BX.ajax.runAction is the method to launch ajax actions in module that returns BX.Promise. In case the csrf token has expired, it will attempt to restore it (only one attempt is made) and repeat the query. If receives query from server, which has status not equal to success
- promis is rejected.
Parameters
Parameter | Description | Available from version |
---|---|---|
action {string} | Action to be launched. For example, disk.folder.get. | |
config {Object} | Parameters:
|
Example
BX.ajax.runAction('disk.folder.get', { data: { folderId: 1 }, analyticsLabel: { viewMode: 'grid', filterState: 'closed' } }).then(function (response) { console.log(response); /** { "status": "success", "data": { "ID": 1, ... }, "errors": [] } **/ }, function (response) { //here the location to receive all responses with status !== 'success' console.log(response); /** { "status": "error", "errors": [...] } **/ });
© «Bitrix24», 2001-2024