1. #1
    Sencha User
    Join Date
    Sep 2012
    Posts
    19
    Vote Rating
    1
    Shadin_a is on a distinguished road

      0  

    Default How to create a subclass for render - send a parameter ?

    How to create a subclass for render - send a parameter ?


    I have a checkitem menu and I want to add icons to each menu item, so I inserted each icon after the menu item is rendered.

    peace of my code:


    Code:
    {   xtype: 'menucheckitem',
         text: 'First Arrow'
         listeners: {
               render: {
                     fn: me.onMenucheckitemRender,
                     scope: me
                            }
                         }
    }
    Code:
    onMenucheckitemRender: function (abstractcomponent, options)
    {
    Ext.DomHelper.insertAfter(abstractcomponent.getEl().down(".x-menu-item-icon"), {
        tag: 'img', 
        src: "icons/arrow1.png"
    });
    }
    This works just fine, but since I will need it many times with different icons, I would like to know how to create a subclass so I can reuse this functionality.

    Thank you

  2. #2
    Sencha - Ext JS Dev Team dongryphon's Avatar
    Join Date
    Jul 2009
    Posts
    1,294
    Vote Rating
    121
    dongryphon is a name known to all dongryphon is a name known to all dongryphon is a name known to all dongryphon is a name known to all dongryphon is a name known to all dongryphon is a name known to all

      0  
    Don Griffin
    Ext JS Development Team Lead

    Check the docs. Learn how to (properly) report a framework issue and a Sencha Cmd issue

    "Use the source, Luke!"

Thread Participants: 1

Tags for this Thread