twigkit / tempo

Tempo is an easy, intuitive JavaScript rendering engine that enables you to craft data templates in pure HTML.
http://tempojs.com/
Apache License 2.0
709 stars 73 forks source link

Tempo 2.0 and Nested Lists #63

Open diedric opened 11 years ago

diedric commented 11 years ago

Hello, Congratulations for your framework.

I was working with Phonegap, JQM and Tempojs1.8 and when I've tried to run the app in Android 4.0 show empty item in lists. I read somthing about that, and this fix with 2.0 version.

The problem is nested lists repeat the values in child nodes. These nested child have the same {{NameVariables}} than parents.

Thank's

Josep

mrolafsson commented 11 years ago

Hi Josep - and thank you! I've only tested Tempo 2.0 briefly in an Android emulator and it seemed to work fine. I thought there were no issues with recursion like that? Is this example not like what you describe: http://tempojs.com/2.0/examples/recursion Let me know if I can help!

mrolafsson commented 11 years ago

Any further thoughts on this?

diedric commented 11 years ago

Thank you very much!!! I tried it and runs ok. The problem was the tag "data-template-for" in childs because I wrote "data-template".

Now I'm working in a way to refresh the data without reload the page. I've tried the clear action but then disapear the template.

Best regards

Josep

mrolafsson commented 11 years ago

Great. Yes, the way to do that would be to get the rendering engine in a variable: var tempo = Tempo.prepare('yourcontainer');

and then use append method iteratively: tempo.append(yournewdata);

Let me know if you have issues.

mrolafsson commented 11 years ago

On data-template-for yes, sorry there were some syntactical changes between 1.8 and 2.0. Thanks for your support!