[Django]-Dojo Widgets not rendering when returned in response to XhrPost

3đź‘Ť

âś…

My guess would be that your Tabs and BorderContainer do not have a height. They won’t automagically attach themselves to a parent container, you must be explicit about their size. dojo.parser.parse portion is required based on how you are injecting the content, though if “centerPane” were a ContentPane you could just attr(“content”, response) and the parsing would be done for you. Also, all BorderContainer’s need a region=”center” (one), and neither of your above snippets contain one.

👤dante

0đź‘Ť

Note that the .innerHTML field applies to DOM objects not to Dojo objects. I think you ought to use dojo.byId(“centerPane”).containerNode.innerHTML = …

Added: I took a look at the documentation for dijit.byId and here is what it says:

dijit.byId is a function for looking up a specific widget by its
assigned name (id). This function is similar to dojo.byId but whereas
dojo.byId returns DOMNodes, dijit.byId returns a JavaScript object
that is the instance of the widget.

This is the reason why it worked for you.

Leave a comment