Recursive rendering in helper.js is correct?
-
Hi, I'm using Jsreport and I want say it is wonderful in my opinion.
I'm using it a little time ago and I doing things that maybe aren't correct.
I need help in some things that I have doubts, some are:
Sometimes I have to use recursive rendering so I decided to do it in the helper.js as a string sum and then send it to the html template for rendering.
-Is this a performance problem?
-Is there any alternative to paint recursive things using template engines ?
If someone can help me with some information, I'll thank them. Thank you
-
hi!
Sometimes I have to use recursive rendering so I decided to do it in the helper.js as a string sum and then send it to the html template for rendering.
-Is this a performance problem?i don't think this is bad, if you are only using string concatenation to produce final html, that should be fine and performance should not be a problem.
Is there any alternative to paint recursive things using template engines ?
depending on the kind of content that you want to produce you can try to put repetitive parts in assets and then use them inside your template in a recursive way, probably it would work for your. another option that you have for dynamic content is that instead of string concatenation you can create a handlebars partial in helpers and use that partial in your template.
you can try to create some examples in playground if you need more help.
-
a very quick answer, I think it can help me. Thanks