Get Object Clicked on From a List

How do i get an object clicked on in a list?

Specifically, I have a list of sets in a list. When i click it, I want the page to change to the ‘setItems’ page and set the title of that page to the name of the set. How do i access the set object clicked on in the list so i can get the name? (i.e. how do i get the setName var in the attachEvent function below)

sets = new dhx.DataCollection(datatype: “json”)
$$(“setsList”).sync sets, this

$$(“setsList”).attachEvent “onItemClick”, (id) ->
@setCursor id
setName = ??? #how do i get this based on the clicked obj
$$(“viewname”).setValue setName

not quite sure, but probably


this.item(id) - returns object which was clicked, so you can access any of its properties

Yup that works