[OPEN] [#1321] [4.0.0] CycleButton icon issue

  1. #1

    [OPEN] [#1321] [4.0.0] CycleButton icon issue

    If using IconUrl the icon will not initially show even though the item is selected. After clicking the button the icons appear. It works better when using Icon (not IconUrl), but then one have to use a standard icon from the Icon-enum.

            x.CycleButton().ShowText(true)
                .Menu(x.Menu()                
                    .Items(
                        x.CheckMenuItem().Text("Test 1")
                            .IconUrl("/extjs/packages/theme_crisp/build/resources/images/tree/folder-open-png/ext.axd")
                        ,
                        x.CheckMenuItem().Text("Test 2")
                            .IconUrl("/extjs/packages/theme_crisp/build/resources/images/tree/folder-png/ext.axd")
                    )
                )
    Last edited by sveins12; May 03, 2016 at 2:40 AM.
  2. #2
    Hello @sveins12!

    Thanks for reporting the issue! It seems this might have been a side effect ("deffect") from another fix.

    I noticed that when using just 'icon' from ExtJS does not show any icon on the cycle button at all. It seems the functionality is meant to limit the icon to the menu entries. Ext.NET is behaving 'in betweens' so it should either adopt icons from load or mimic ExtJS behavior.

    Using IconCls seems the best way for now. It works on both ExtJS and Ext.NET the way you expect it to. If you want to consider using it, you'd have to have:
    <style type="text/css">
        .folder-open-icon {
            background-image: url("/extjs/packages/theme_crisp/build/resources/images/tree/folder-open-png/ext.axd") !important
        }
    
        .folder-icon {
            background-image: url("/extjs/packages/theme_crisp/build/resources/images/tree/folder-png/ext.axd") !important
        }
    </style>
    and change your code to:
    x.CycleButton().ShowText(true)
        .PrependText("IconCls: ")
        .Menu(x.Menu().Items(
            x.CheckMenuItem().Text("Test 1")
                .IconCls("folder-open-icon"),
            x.CheckMenuItem().Text("Test 2")
                .IconCls("folder-icon")
        )
    )
    As a workaround closer to your first attempt (the above is not a workaround, is intended designed usage), you may do the following:
    x.CycleButton().ShowText(true)
        .IconUrl("/extjs/packages/theme_crisp/build/resources/images/tree/folder-open-png/ext.axd")
        .PrependText("IconUrl: ")
        .Menu(x.Menu().Items(
            x.CheckMenuItem().Text("Test 1")
                .IconUrl("/extjs/packages/theme_crisp/build/resources/images/tree/folder-open-png/ext.axd"),
            x.CheckMenuItem().Text("Test 2")
                .IconUrl("/extjs/packages/theme_crisp/build/resources/images/tree/folder-png/ext.axd")
        )
    )
    We have logged this issue under #1321, you can see more details there. We will also update here once we fix the issue!
    Fabrício Murta
    Developer & Support Expert

Similar Threads

  1. [OPEN] [#748] TextField Icon Align
    By RCN in forum Bugs
    Replies: 2
    Last Post: Mar 06, 2015, 4:09 PM
  2. Replies: 2
    Last Post: Jun 26, 2013, 8:12 AM
  3. [CLOSED] Icon is not showed with the ActiveItem using CycleButton
    By flormariafr in forum 1.x Legacy Premium Help
    Replies: 5
    Last Post: Mar 05, 2010, 4:45 AM
  4. Replies: 24
    Last Post: May 23, 2008, 12:50 PM
  5. Replies: 5
    Last Post: Mar 15, 2008, 3:53 PM

Posting Permissions