1. #1
    Sencha User
    Join Date
    Sep 2012
    Posts
    21
    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
    Location
    Kansas
    Posts
    1,512
    Vote Rating
    176
    dongryphon has much to be proud of dongryphon has much to be proud of dongryphon has much to be proud of dongryphon has much to be proud of dongryphon has much to be proud of dongryphon has much to be proud of dongryphon has much to be proud of dongryphon has much to be proud of

      0  
    Don Griffin
    Engineering Manager - Frameworks (Ext JS / Sencha Touch)

    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