The HTML Renderer
This is a component that is completely unique to the Dojo implementation of the Django Template Language and is basically unrelated to the language itself. It is an object that is designed to render templates and make sure they are inserted into the DOM properly. It also add an important component for large templates, the ability to make sure that changes in the DOM are done in batches, though this ability is turned off by default, and even when turned on, can be done at a variety of levels
This is the object to use to make sure that rendering/unrendering happens properly, and what you want to use if you want to render a template, but don't want to use a widget to do it. All users are strongly encourage to use this to render a template if they are not using dojox.dtl._Widget to render their templates.
The object can be found at dojox.dtl.render.html.Render. It has two functions: setAttachPoint and render. It must have an attach point, which can be set in the constructor, or through the setAttachPoint function.
The setAttachPoint function simply sets the node we want to use to append the rendered template to.
The render function does several nice things:
- Unrenders the previous template if we're now using a new template.
- Creates a buffer if one hasn't been passed.
- Manages the batch change functionality discussed above.
- Inserts the rendered template into the document.
- Printer-friendly version
- Login or register to post comments
- Unsubscribe post