I have a form submission that is rendering a gsp template and inserting it at a DIV after it completes. I want to be able to use javascript widgets in my template that is being rendered, so I don’t have to have static looking sections of the page.
So in the template I am rendering with my model, I have something like this:
${search.project?.encodeAsHTML()}> ${search.name?.encodeAsHTML()}
where what I am trying to do is make the text that would be wrapped in the <td> tag show up with a dijit tooltip widget when I hover the mouse over it.
Presently, this is just rendering the search.project text as regular text in the table cell. I guess this is because the widget isnt loading correctly? How can I make sure the table that’s being inserted at the div after the AJAX call gets its widgets rendered as well?
You can parse your template after it is inserted into the page, to load widgets inside it. There is method
dojo.parser.parse, which accepts node or id as an argument, and will create and register all dijits inside this node. So after adding html containing dijits to your page, you can call parser:And
dojo.parserand your widgets should be required in the page.