[CLOSED] Button Icon

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1

    [CLOSED] Button Icon

    Hello!
    I need to draw a flag icon in a button in order to show the selected language.
    The button is in _Header.cshtml, so I don't have codebehind.
    I would like to set it via javascript.

    The following code works fine:

          <ext-button id="LanguageButton"
                        variant="Light"
                        scale="Medium"
                        text=""
                        hidden="false"
                        icon="/images/flag_italy.png"
                        margin="5"
                        onClientClick="">
                <menu>
                    <ext-menu plain="true">
                        <items>
                            <ext-menuItem id="LangItMenuItem" text="Italiano" icon="/images/flag_italy.png">
                                <listeners>
                                    <click handler="alert('Italiano!');" />
                                </listeners>
                            </ext-menuItem>
                            <ext-menuItem id="LangEnMenuItem" text="English" icon="/images/flag_usa.png">
                                <listeners>
                                    <click handler="alert('English!');" />
                                </listeners>
                            </ext-menuItem>
                        </items>
                    </ext-menu>
                </menu>
            </ext-button>
    I would like to create a js which reads inside a cookie the preferred language and sets the correct icon to the LanguageButton.

    App.LanguageButton.setIcon('...') or App.LanguageButton.icon = '...' do not work;
    I tried to use the iconCls but it becomes white (maybe because of a wrong implementation).

    .bbros-flag-it {
        background:url(/images/flag_italy.png);
    }
    Could you please help me?
    Thank you much!
    Last edited by fabricio.murta; Sep 25, 2021 at 4:01 PM. Reason: The issue was transient and couldn't be reproduced by either party at some point.

Similar Threads

  1. [CLOSED] Custom Icon on a Button
    By xtoolz in forum 2.x Legacy Premium Help
    Replies: 3
    Last Post: Jun 13, 2014, 8:31 AM
  2. [CLOSED] Changing Button Icon
    By MarginPoint in forum 1.x Legacy Premium Help
    Replies: 1
    Last Post: Mar 11, 2014, 10:57 AM
  3. [CLOSED] how to change button's icon in 2.0
    By Fahd in forum 2.x Legacy Premium Help
    Replies: 2
    Last Post: Jul 12, 2012, 8:59 PM
  4. Icon button and user controls
    By maxdiable in forum 1.x Help
    Replies: 3
    Last Post: May 14, 2010, 2:33 AM
  5. [CLOSED] [1.0] button's icon not displayed
    By PoloTheMonk in forum 1.x Legacy Premium Help
    Replies: 4
    Last Post: Jan 07, 2010, 7:36 AM

Posting Permissions