Changing Extent on Map Gallery Selection

Discussion created by garyfreemanus on Jan 5, 2011
Latest reply on Jan 6, 2011 by hzhu
I have setup a custom BasemapGallery specifying individual layers for each node.

I am now looking to set unique extents values for each node (esriBasemapGalleryNode). I am looking for a clean way to identify the selected node so I can index or reference extent values I will maintain for each node. I have not been able to identify the nodes index within the gallery from the object returned from a query locating the esriBasemapGallerySelectedNode. I can loop through the basemap array that I used to initialize the gallery with some string parsing and comparing against each ID parsing out the ID from the selected node, but have concerns it could break with future changes to the map gallery dijit.

// 3rd node in the gallery
esriBasemapGallerySelectedNode returned object referenced has an id: "galleryNode_add_2"

// basemap array used to initialize map gallery dijit
basemaps: Array[4]
0: Object
id: "add_0"
layers: Array[1]
thumbnailUrl: "images/....png"
title: "Landbase"
__proto__: Object
1: Object
id: "add_1"
layers: Array[2]
thumbnailUrl: "images/....png"
title: "C Zone"
__proto__: Object
2: Object
id: "add_2"
layers: Array[2]
thumbnailUrl: "images/....png"
title: "F Zone"
__proto__: Object
3: Object
id: "add_3"
layers: Array[2]
thumbnailUrl: "images/....png"
title: "B Zone"
__proto__: Object
length: 4
__proto__: Array[0]

Snippet of code
var zoneLayer = new esri.dijit.BasemapLayer({
var zoneBasemap = new esri.dijit.Basemap({

// Getting selected node... I can extent to do the parsing and comparing
dojo.connect(basemapGallery, "onClick", function(evt) {
   var sNode = null;
   sNode = dojo.query('.esriBasemapGallerySelectedNode');

Is there anyway to set a user defined property to each esriBasemapGalleryNode on initialization?
Is there way to get the index of the esriBasemapGallerySelectedNode?
Is there a way to set the ID on each node?

Thanks, Gary