AnsweredAssumed Answered

Email Link - Shows multiple times with .actionlist

Question asked by KeitherJ on Feb 6, 2015
Latest reply on Feb 7, 2015 by rscheitlin

Friends of the mighty Javascript API-


I have been working with this example in my source:


History API to track selected feature | ArcGIS API for JavaScript


I have been trying many things to keep the Email link to not show up multiple times when it hits query(.actionlist.


I am loading a different single layer each Map Click of a Treeview control. Its always named  "theLayer".

I have tried many other Map events and also checking if the emailLink is already created...without any luck.


map.on("layer-add-result", function (result) {
    if (result.layer === theLayer) {
        console.log('THE layer');
        // Add a link into the InfoWindow Actions panel       
        //if (!dom.byId("emailLink")) {  
        //    domConstruct.create("span", {  
        //        id: "emailLink"  
        //    }, query(".actionList",[0]);  
        var emailLink = domConstruct.create("a", {
            "class": "action",
                "innerHTML": "Email Map",
                "href": "javascript:void(0);"
        }, query(".actionList", map.infoWindow.domNode)[0]);
        //}, "emailLink", "only");



Any suggestions would be grateful