Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to change dojo/dijit tab title programmatically?

For example, given the dijit.ContentPane tab below, how do I programmatically change the title "Summary" to something else?

<div id="summaryContent" class="tabClass" dojoType="dijit.layout.ContentPane" title="Summary" selected="true">

I tried:

dojo.byId('summaryContent').title
document.getElementById('summaryContent').style.title

...as well a bunch of other combinations, but it doesn't work? Any ideas?

like image 958
Mark Logan Avatar asked Jul 06 '11 14:07

Mark Logan


1 Answers

Just two small mistakes: first, to get a dijit instance (e.g. the dijit.layout.ContentPane javascript object, not the DOM node) you have to use dijit.byId, and secondly, setting a property on a dijit is done with the set method. So:

dijit.byId("summaryContent").set("title", "My new awesome title");

.. should do the trick.

like image 164
Frode Avatar answered Oct 24 '22 10:10

Frode