1. #1
    Sencha Premium Member
    Join Date
    Feb 2013
    Posts
    50
    Answers
    1
    Vote Rating
    2
    vicvolk87 is on a distinguished road

      0  

    Default Answered: Tabclosemenu with an icon

    Answered: Tabclosemenu with an icon


    Hi, guys! I use tabcloseplugin in my application. I've just tried to set "iconCls" property for a particular item in a context menu, which appears on right-click, but to no avail. It seems as if this property is ignored. I wonder whether it is a bug or not?

    I tried to override it like this
    Code:
    if (me.showCloseAll) {
          items.push({
                  text: me.closeAllTabsText,
                  scope: me,
                  iconCls: 'close-icon', // <-- This does not have any effect
                  handler: me.onCloseAll
          });
     }

  2. Not sure off-hand. And it might even be different on different browsers, though I suspect it's not. You can inspect the close tool on a closable panel (or tab in a tabpanel) to see what image (or likely image sprite slice) is used for the close tool.

  3. #2
    Sencha - Support Team slemmon's Avatar
    Join Date
    Mar 2009
    Location
    Boise, ID
    Posts
    5,021
    Answers
    385
    Vote Rating
    183
    slemmon is a splendid one to behold slemmon is a splendid one to behold slemmon is a splendid one to behold slemmon is a splendid one to behold slemmon is a splendid one to behold slemmon is a splendid one to behold slemmon is a splendid one to behold slemmon is a splendid one to behold

      0  

    Default


    Where are you using that code snippet? In an extension class of tabclosemenu in the constructor? other?

  4. #3
    Sencha Premium Member
    Join Date
    Feb 2013
    Posts
    50
    Answers
    1
    Vote Rating
    2
    vicvolk87 is on a distinguished road

      0  

    Default


    Not in the constructor, but right in the "createMenu" definition. Your question made me think, that I should put it somewhere else. So, if it should be done in the constructor, please, tell me how it should look like.

  5. #4
    Sencha - Support Team slemmon's Avatar
    Join Date
    Mar 2009
    Location
    Boise, ID
    Posts
    5,021
    Answers
    385
    Vote Rating
    183
    slemmon is a splendid one to behold slemmon is a splendid one to behold slemmon is a splendid one to behold slemmon is a splendid one to behold slemmon is a splendid one to behold slemmon is a splendid one to behold slemmon is a splendid one to behold slemmon is a splendid one to behold

      0  

    Default


    You might actually override the plugin using define > override syntax and you'd override the createMenu method altogether.

    There's an override syntax example in the API doc for define here:
    http://docs.sencha.com/extjs/4.2.0/#...-method-define

  6. #5
    Touch Premium Member
    Join Date
    Feb 2011
    Location
    NJ
    Posts
    311
    Answers
    59
    Vote Rating
    52
    droessner is a jewel in the rough droessner is a jewel in the rough droessner is a jewel in the rough

      1  

    Default


    That works for me. What does the close-icon css class look like?

  7. #6
    Sencha - Support Team slemmon's Avatar
    Join Date
    Mar 2009
    Location
    Boise, ID
    Posts
    5,021
    Answers
    385
    Vote Rating
    183
    slemmon is a splendid one to behold slemmon is a splendid one to behold slemmon is a splendid one to behold slemmon is a splendid one to behold slemmon is a splendid one to behold slemmon is a splendid one to behold slemmon is a splendid one to behold slemmon is a splendid one to behold

      1  

    Default


    Not sure off-hand. And it might even be different on different browsers, though I suspect it's not. You can inspect the close tool on a closable panel (or tab in a tabpanel) to see what image (or likely image sprite slice) is used for the close tool.

  8. #7
    Sencha Premium Member
    Join Date
    Feb 2013
    Posts
    50
    Answers
    1
    Vote Rating
    2
    vicvolk87 is on a distinguished road

      0  

    Default


    Made it work in 4.2. For some reason the very same code didn't work in 4.1. Thank you all, guys!

Thread Participants: 2