How to programmatically change the name of a dojo / dijit tab?

For example, given the dijit.ContentPane tab below, how can I programmatically change the Summary header 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 as many other combinations, but this does not work? Any ideas?

+5
source share
3 answers

Only two small errors: firstly, to get a dijit instance (for example, a javascript object dijit.layout.ContentPane, not a DOM node), you have to use dijit.byId, and secondly, setting the property to dijit is done using the method set. So:

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

.. should do the trick.

+10
source

, , :

"dijit/registry" (https://dojotoolkit.org/reference-guide/1.10/dijit/registry.html)

:

var summaryContent = registry.byId("summaryContent");
summaryContent._set("title", "new title here");
//Set something like the icon
summaryContent._set("iconClass", "summary-icon");
0
  • div "dijit.byId".
  • dijit ( "dijit.byId" ), 'set' .

: dijit.byId( "summaryContent" ). set ( "title", "New Title" );

* : , .

-1

All Articles