Custom Code
Custom code allows you to access the panel's options, REST API responses, form elements, and various Grafana services.
Custom code is executed after the Initial
and Update
requests, when Element Value Changed
.
Parameters
Parameter | Description | Initial, Update | Change Value | ShowIf, DisableIf, Get Options |
---|---|---|---|---|
context.element | Current element | ✔️ | ||
context.panel.data | Result set of panel queries. | ✔️ | ✔️ | ✔️ (For Get Options ) |
context.panel.elements | Form elements. | ✔️ | ✔️ | ✔️ |
context.panel.initial | Parsed values from the initial request. | ✔️ | ✔️ | |
context.panel.initialRequest() | Performs an initial request to reload the panel. | ✔️ | ✔️ | |
context.panel.options | Panel's options. | ✔️ | ✔️ | |
context.panel.onOptionsChange({}) | Modifies a handler to refresh the panel. |