leonidas / transparency

Transparency is a semantic template engine for the browser. It maps JSON objects to DOM elements by id, class and data-bind attributes.
http://leonidas.github.com/transparency/
MIT License
969 stars 112 forks source link

iterative lists rendering doesn't work with data-* attributes #110

Open webraptor opened 11 years ago

webraptor commented 11 years ago

iterative lists rendering only works with class. if "data-*" or "id" attributes are used nothing gets rendered

pyykkis commented 11 years ago

hm...could you post a http://jsfiddle.net/ example or something? data-bind should work, for other data-* attributes you should set a custom matcher, see Configuration section in the readme.

id attribute might be problematic for lists, as they should be unique.

webraptor commented 11 years ago

Yeah I referred to data-bind, didn't change the matcher for any other attribute. I tried it even on the demo at http://leonidas.github.io/transparency/ under the "Iterating over a list" section. If I fiddle with the javascript over there and change the class attribute to a data-bind one it will no longer work.

Here's the jsfiddle http://jsfiddle.net/Ls57N/

Also, is there any way to make it work with elements added after initial DOM loading? IE: if added via jQuery's append , appendTo etc.