I am working with v.3.11 of the JS API and am having issues with the click event for the Bookmarks Dijit.
Does anyone have any ideas how to return the actual BookmarkItem that was clicked in the bookmark dijit? Currently, the event returns an object that includes the whole bookmark dijit itself, which seems to defeat the purpose of a click event.
Appreciate any help,
Joe
Solved! Go to Solution.
This is not supported in the publicly exposed API of the Bookmarks widget, you could however use a 'private' function to accomplish what you want. This might break with a new version of the API though, so use with caution.
require(["dojo/aspect", "esri/dijit/Bookmarks"], function(aspect, Bookmarks) { ... var bookmarkWidget = new Bookmarks(..); aspect.after(bookmarkWidget, "_onClickHandler", function(bookmarkItem) { // do something with bookmarkItem }, true); ... });
Hi Joe,
I think it is returning the bookmarkitem ( name and it's extent). Please look Bookmark Widget(Read-only Bookmarks)
Thanks,
Mahtab
This is not supported in the publicly exposed API of the Bookmarks widget, you could however use a 'private' function to accomplish what you want. This might break with a new version of the API though, so use with caution.
require(["dojo/aspect", "esri/dijit/Bookmarks"], function(aspect, Bookmarks) { ... var bookmarkWidget = new Bookmarks(..); aspect.after(bookmarkWidget, "_onClickHandler", function(bookmarkItem) { // do something with bookmarkItem }, true); ... });
This is just what I was looking for.
Thanks for the help!