Login Register

extension

Setting a Dialog's Title dynamically

I've seen the question asked a number of times on how to set a Title on things like Dialog and TitlePane after parsing. There is currently no public method to do this, but it's uber easy, so lets take a peek:

the template for Dialog has something like:

${title}

in it. this attaches a "titleNode" attribute to our dijit. Its a pointer to the actual domNode where the text
is:

// what's the current title of the dialog? the innerHTML of the titlenode.
console.log(dijit.byIt("myDialog").titleNode.innerHTML);
Syndicate content