Login Register

Dialog - setting the title programatically (0.9B)

Would appear that a dialog title has to be set at create time and cannot be altered once it has been created, i.e. there is no:

this.titleNode.innerHTML = this.title;

in the setData function.

Is this by design, due to some rendering wierdness avoidance or should I raise a formal enhancement request to get this included as it would appear to be essential for programatic dialog manipulation?

Never any harm in opening a

Never any harm in opening a ticket... if its invalid or something we wont add... it will get closed out right away with the appropriate information/status. Just be sure to include a form of contact incase you are submitting code (requires CLA for us to use) or we need more details.

-Karl

I came up with a

I came up with a workaround...
dlg.titleNode.innerHTML = 'your title'
But this is not a very good way of setting titles,
is there any other documented way of doing it?

no thats just regular

no thats just regular javascript stuff. you could add a method to mixin: (which is all the dijit would be doing internally) ...

...
setTitle: function(title){ this.titleNode.innerHTML = title; },
...

though it could be argued that any widget that accepts a title="" attribute should have a setTitle method.

I think that the issue here

I think that the issue here is not about adding a method or not,
but about elaborating a documented procedure to set Dialog title
that everyone will use.
Lot of people don't know about titleNode existence.

as the API tool progresses,

as the API tool progresses, hopefully that stuff will become more apparent.

and actually, thinking about it, setting the TitleNode may be bad in the dialog (via .innerHTML) because the iconNode is in there, unless there is a more direct location to the text alone. the file templates/Dialog.html lists all of the nodes available in the Dialog instance, titleNode, focusNode, arrowNode etc are all very common (though not completely documented) ...