require(["esri/opsdashboard/featureActionProxy"], function(featureActionProxy) { /* code goes here */ });
Description
(Added at v3.14)
(Currently in Mature Support) featureActionProxy is a singleton object that allows implementing an operations dashboard Feature Action extension. A Feature Action has no user experience, it is a piece of code that is requested to execute on a set of features. Since the proxy is implementing ExtensionBase, the same host functions and the same events are available. For optimization purpose, a feature action extension is kept alive in the host and reused for all the widget that use the same feature action extension extension. For example, myCustomFeatureAction could be used multiple time in an operation view, on a map widget, on a list widget, and on a pie chart widget. Even if a custom feature action extension is reused multiple time in an operation view, it's possible that different configurations were defined for each widget. for each instance of a same type of feature action. This is why the configuration of a feature action is passed on each execute event. For this reason, a feature action should not keep any state and the configuration of a feature action will passed as an argument on each execute request. The most important event to listen to is execute.
For an extension FeatureAction, configuration properties can be captured automatically by using manifest configuration properties and additional properties can be captured if a FeatureAction configuration user experience is provided.
require(["esri/opsdashboard/featureActionProxy"], function (featureActionProxy) {
featureActionProxy.on("execute", function (eventProperties) {
// Do something with the event properties
var configProperty = eventProperties.config.propertyIWantoSave;
});
});
An extension is defined by the json manifest file. Some configuration properties could or could not be available based on the manifest properties. The same is applicable to functions and callbacks exposed by the mixin (see
the manifest documentation).
See also
Samples
Search for
samples that use this class.
Class hierarchy
esri/opsdashboard/ExtensionBase
|_esri/opsdashboard/featureActionProxy
Properties
isNative | Boolean | Read-only: Indicates if the host application is the Windows Operations Dashboard. |
portalHelperServices | Object | Read-only: It will list all of the Portal helper services. |
portalUrl | String | Read-only: The URL to the ArcGIS.com site or in-house portal that you are currently signed in to. |
Methods
Events
[ On Style Events | Connect Style Event ]
All On Style event listeners receive a single event object. Additionally, the event object also contains a 'target' property whose value is the object which fired the event.
Property Details
Read-only: Indicates if the host application is the Windows Operations Dashboard. If false, the host application is the browser based Operations Dashboard.
Read-only: It will list all of the Portal helper services. (Added at v3.16)
Read-only: The URL to the ArcGIS.com site or in-house portal that you are currently signed in to. (Added at v3.15)
Method Details
Get the collection of data sources from the host application. Note: The promise this function returns will fail if the extension manifest do not have a property "useDataFromView" set to true. Deprecated at v3.18
Get the data source corresponding to the data source id from the host application. Note: The promise this function returns will fail if the extension manifest do not have a property "useDataFromView" set to true.
Parameters:
<String > dataSourceId |
Required |
The data source id |
Get the collection of map widgets from the host application.
Get the map widget corresponding to the map widget id from the host application.
Parameters:
<String > mapWidgetId |
Required |
A map widget id |
Called when an error occurred during the initialization process with the host application.
Parameters:
<Error > err |
Required |
The error that occurred. |
Called by the host application when the relationship has been established with the extension. All the configuration properties will be available and the extension functions will be usable when this function has been invoked.
Called by the host application when a map widget has been added to the current view. It could occur when a publisher is adding a map widget when configuring the operation view.
Called by the host application when a map widget has been removed from the current view. It could occur when a publisher is removing a map widget when configuring the operation view.
Parameters:
<String > mapWidgetId |
Required |
A map widget id. |
Event Details
[ On Style Events | Connect Style Event ]
Event indicating that a new data source has been added into the host operation view.
Event Object Properties:
<Object > dataSourceProxy |
The new data source that has been added in the host operation view. |
Event indicating that a data source has been removed from the host operation view.
Event raised when the feature action should execute for a set of features.
Event Object Properties:
<Object > config |
The configuration properties for a particular host instance of the feature action. |
<DataSourceProxy > dataSourceProxy |
The data source origin for the feature set. |
<FeatureSet > featureSet |
The set of features. |
Event indicating that the initialization process was successful. The configuration properties are available, the proxy functions are available, and the proxy events will be fired.
Event indicating that the initialization process encountered an error.
Event indicating that a new map widget has been added into the host operation view.
Event Object Properties:
<MapWidgetProxy > mapWidgetProxy |
The new map widget that has been added in the host operation view. |
Event indicating that a map widget has been removed from the host operation view.