-
-
Notifications
You must be signed in to change notification settings - Fork 278
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Need help: creating a link in a popup that executes method in widget #209
Comments
Have you seen this sample? I am working on adding a email link to the popup, where the email will change based on the indentify.js configuration. See my gist https://gist.github.com/friendde/2ce1841d3956fd29d82f which is incomplete and not working but shows my intent. |
In your gist your comment asks if there is a selction change event, which there is https://developers.arcgis.com/javascript/jsapi/popup-amd.html#event-selection-change |
Thanks @friendde! I have seen that example before, maybe need to review in more detail. What I'm trying to figure out is how to call a method defined in my widget when the link is clicked. With the way contexts work in JS I'm not sure how to accomplish this. Maybe something like this: <a href="fakelink.htm" onclick="lang.hitch( this, this.myWidgetMethod )">Some link</a> I'll take a look at your gist and see if that helps. |
Rather than use the link click event why not use the popup's selection change event to compile your google search url. So when the selection change event occurs you call your method to compile the terms and the link appears on the popup. |
Sorry @friendde. I think I may have confused the issue by including the google search links. I meant those merely as examples and they work fine. It's the additional link I would like to add which needs to call a method in my widget I'm not sure how to do. |
I working on a widget that searches our plant (trees, shrubs) etc. database. It adds it's own feature layer to the map to display the results. The feature layer has a infoTemplate configured that lists attributes for each feature and contains a number of links to Google Image searches passing various attributes (genus, species, plant name etc) as the search term.
I would like to be able to add another link in the infoTemplate that calls a method defined in my widget on click. The method would search the database for similar plants based on attributes of the plant displaying the infoTemplate.
Here's how I am building the infoTemplate:
https://gist.github.com/jebu75/4cc678ebc2ff9e5bcd4c
Is it as simple as this?
Doesn't seem so...
Thanks for any help!
The text was updated successfully, but these errors were encountered: