vwolfley

Link in popup window

Discussion created by vwolfley on Jun 19, 2014
Latest reply on Jun 20, 2014 by VPrasad-esristaff
I am trying to customize the popup window with a link at the bottom.  I have used this example https://developers.arcgis.com/javascript/jssamples/gp_popuplink.html to successfully add a link, but the link appears for each layer that is clicked.  I would like to remove the link when it is not needed for a specific layer.  Here is the code I have been using.  Any suggestions are welcome.  Thanks

//create a link in the popup window.
        var link = dc.create("a", {
            "class": "action",
            "id": "infoLink",
            "innerHTML": "Assessor Info", //text that appears in the popup for the link
            "href": "javascript: void(0);"
        }, query(".actionList", map.infoWindow.domNode)[0]);

        on(link, "click", function() {
            var feature = map.infoWindow.getSelectedFeature();
            // console.log(feature.attributes);
            var url = window.location;
            var link = "";
            if (feature.attributes.COUNTY_FIPS === "13") {
                link = appConfig.MaricopaAssessor + feature.attributes.PARCEL;
                window.open(link);
            }
            if (feature.attributes.COUNTY_FIPS === "25") {
                link = appConfig.YavapaiAssessor + feature.attributes.PARCEL;
                window.open(link);
            }
            else {
                // *** do nothing ***
            }

        });



[ATTACH=CONFIG]34750[/ATTACH]

Attachments

Outcomes