leonidas/transparency — Issue #17: Associate data object with element (when rendering lists)
Author: raimohanska
Created: 2012-02-23 08:32:03+00:00
State: open

When rendering a list, I want to assign event handlers to the list item, and use the model object (list item) in those handlers.

I suggest associating the list item with the corresponding element.

Could we do that by setting a `transparency.model` property in the list element?

I took the first pass at this in my fork at https://github.com/raimohanska/transparency (commit 629611ab8069c6c94d198609614027ede464c32c)

This would work at least in my application code (sample below):

~~~ javascript
// find the associated naviItem from the jQuery element
var naviItem = element.get(0).transparency.model
// now do stuff with the naviItem
// ..
~~~