1

My question is whether or not it is possible to use the default editor widget in my case given the needs of my application. My map consists of points displayed from four different FeatureLayers. They represent four different types of traffic counts, and my application allows users to associate/dissociate them with traffic count data requests. (Count data requests are non-spatial records stored in a data table.) They are displayed on my page below the map in a Dojo DataGrid.

If no traffic count request is selected in the DataGrid, the Editor and TemplatePicker should behave as normal (i.e. they should select points, display the Attribute Inspector, and allow the points to be dragged around). If a request is selected, the Editor should be temporarily disabled so that clicking the point toggles it as being associated/dissociated with the traffic count request clicked in the DataGrid. The AttributeInspector should not be displayed

As it stands right now, if there is a request selected in the DataGrid, clicking a point on the map still brings up the AttributeInspector. Is it possible to customize the Editor in this way?

The definition of my TemplatePicker and the logic of what I want map.on("click") to do is below.

Thanks

function generateTemplatePicker(layers) {
    widget = new TemplatePicker({
        featureLayers: layers,
        rows: "auto",
        columns: 2,
        grouping: false,
        style: "width:98%;"
    }, "templatePickerDiv");

    widget.startup();

    widget.on("selection-change", function() {
        unselectRequest();
        selected = widget.getSelected();
    });
}

map.on("click", function(evt) {
        if (selected) {
            var newPoint = new Graphic(evt.mapPoint, selected.symbol, null);
            selected.featureLayer.applyEdits([newPoint], null, null);
            widget.clearSelection();
        } else {
            if (!evt.graphic) {
                if (requestEditingMode) { 
                    unselectRequest(); 
                } 
                else { 
                    //*HIDE ATTRIBUTE INSPECTOR*// 
                }
            } else if (!requestEditingMode) {
                //*SHOW ATTRIBUTE INSPECTOR*//
            } else {
                var pointAlreadyRequested = pointIsRequested(evt.graphic._graphicsLayer.id, evt.graphic.attributes.OBJECTID);
                if (pointAlreadyRequested) { removePointFromRequest(evt); } 
                else { addPointToRequest(evt); }
            }
        }
    });

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.