AnsweredAssumed Answered

Using AttributeInspector in a custom Operations Dashboard widget

Question asked by jbailey.spatialbridge on Sep 12, 2015

Are there any good examples available of using the AttributeInspector widget inside of a custom Operations Dashboard widget?

 

Currently, I've got the AttributeInspector widget inside of the custom widget, but I can't figure out how to get a reference to the feature layer to set it on the LayerInfos property for the AttributeInspector. Here's a snippet of the code that I have so far in my custom widget's JavaScript file:

  

return declare("CustomWidget", [_WidgetBase, _TemplatedMixin, _WidgetsInTemplateMixin, WidgetProxy], {
        templateString: templateString,
        debugName: "CustomWidget",

        hostReady: function () {
            // get a reference to the data source configuration
            var dataSource = this.dataSourceProxies[0];
            var dataSourceConfig = this.getDataSourceConfig(dataSource);

            // create the layerInfos
            var layerInfos = [
                {
                    'featureLayer': ???,
                    'showAttachments': true,
                    'isEditable': true,
                    'fieldInfos': [
                        {
                            'fieldName': 'OBJECTID',
                            'isEditable': false,
                            'label': 'OBJECTID'
                        }
                    ]
                }
            ];

            var attributeInspector = new AttributeInspector({
                layerInfos: layerInfos
            }, document.getElementById("attributeInspector"));

Outcomes