screenitem.updatebyposition

Description

object screenitem.updatebyposition(array **screenItems**)

This method allows to update screen items in the given screen cells. If a cell is empty, a new screen item will be created.

Parameters

(array) Screen item properties to be updated.

The x, y and screenid properties must be defined for each screen item, all other properties are optional. Only the passed properties will be updated, all others will remain unchanged.

Return values

(object) Returns an object containing the IDs of the updated and created screen items under the screenitemids property.

Examples

Changing a screen items resource ID

Change the resource ID for the screen element located in the upper-left cell of the screen.

Request:

  1. {
  2. "jsonrpc": "2.0",
  3. "method": "screenitem.updatebyposition",
  4. "params": [
  5. {
  6. "screenid": "16",
  7. "x": 0,
  8. "y": 0,
  9. "resourceid": "644"
  10. }
  11. ],
  12. "auth": "038e1d7b1735c6a5436ee9eae095879e",
  13. "id": 1
  14. }

Response:

  1. {
  2. "jsonrpc": "2.0",
  3. "result": {
  4. "screenitemids": [
  5. "66"
  6. ]
  7. },
  8. "id": 1
  9. }

See also

Source

CScreenItem::update() in ui/include/classes/api/services/CScreenItem.php.