0
votes

As the title of this post already says: I'm trying to toggle an icon in my tabcontainer.

I got a TabContainer with some ContentPanes in it.

If I get some values from the database I show them in the ContentPane and set the IconClass so the user see that there is some data.

In the my ContentPane I also got a delete and a save button.

If there was some data and the delete button is pressed I'd like to remove or to hide the Icon in the Tab.

Of course I want to do the other way, too.

But how do I do it?

I tried it with registry.byId("myIdOfTheContentPaneWhereTheIconClasswasDefined").className="dijitNoIcon"

without an effect.

Any ideas?

2

2 Answers

0
votes

Try setting iconClass instead of className.

Proof-of-concept:

require([
    'dijit/layout/TabContainer',
    'dijit/layout/ContentPane'
], function(TabContainer, ContentPane){
    var container = new TabContainer({ id: 'container' }).placeAt(document.body);
    var pane = new ContentPane({
        iconClass: 'dijitIconSave',
        title: 'Tab'
    }).placeAt(container);
    container.startup();

    setTimeout(function () {
        pane.set('iconClass', '');
    }, 2000);
});
0
votes

registry.byId returns you a widget, not a domNode.

This should work: registry.byId("myIdOfTheContentPaneWhereTheIconClasswasDefined").domNode.className="dijitNoIcon

although it is not elegant at all...