1. #1
    Sencha User
    Join Date
    Apr 2010
    Location
    Russia, Krasnodar
    Posts
    20
    Vote Rating
    0
    guyfawkes is on a distinguished road

      0  

    Default Unanswered: Render and afterrender in ExtJS 4.1 don't work

    Unanswered: Render and afterrender in ExtJS 4.1 don't work


    Hello. I just downloaded ExtJS 4.1 Final. I use control method in my controller to do some actions on panel and treepanel render. This code works perfectrly in ExtJS 4.0.7, but it doesn't works in ExtJS 4.1 Final. How can I to fix this problem? Example: trivial method init in Controller: init : function () { var me = this, me.control({ 'managers-groupstree' : { render : function (component) { alert('never works!'); }, ... View is simle TreePanel with alias : 'widget.managers-groupstree'.

  2. #2
    Sencha - Support Team scottmartin's Avatar
    Join Date
    Jul 2010
    Location
    Houston, Tx
    Posts
    9,154
    Vote Rating
    475
    Answers
    685
    scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future

      0  

    Default


    Can you please provide a small test case of your problem so we can have a look?

    Regards,
    Scott.

  3. #3
    Sencha User
    Join Date
    Apr 2010
    Location
    Russia, Krasnodar
    Posts
    20
    Vote Rating
    0
    guyfawkes is on a distinguished road

      0  

    Default


    I added example. Sorry, but I haven't format controls in forum message form, but in settings there are wysiwyg.

  4. #4
    Sencha User
    Join Date
    May 2010
    Location
    Kiev, Ukraine
    Posts
    135
    Vote Rating
    7
    Answers
    14
    khmurach is on a distinguished road

      0  
    Vitaliy Khmurach
    Web Developer
    http://ext4all.com

  5. #5
    Sencha Premium Member
    Join Date
    Aug 2011
    Location
    India
    Posts
    36
    Vote Rating
    4
    Answers
    1
    vasanth.kvj is on a distinguished road

      0  

    Default afterrender not working in Extjs 4.1

    afterrender not working in Extjs 4.1


    Yes afterrender is not working for me in 4.1, but the same works perfectly in 4.0.7

    In controller
    -----------------
    '#megamenuclose': {
    afterrender: function (cmp) {
    cmp.getEl().on('click', this.closeMenu);
    }
    }

  6. #6
    Sencha User castitas's Avatar
    Join Date
    Sep 2011
    Location
    US
    Posts
    116
    Vote Rating
    3
    Answers
    3
    castitas is on a distinguished road

      0  

    Default


    Both of these events are working for me. Some things to check:
    1) Are you sure your reference is right? Try it out in Ext.ComponentQuery.query('ref').
    2) Check your spelling. itemid is different from itemId.
    3) Did you declare the itemId/xtype?

  7. #7
    Sencha Premium Member
    Join Date
    Aug 2011
    Location
    India
    Posts
    36
    Vote Rating
    4
    Answers
    1
    vasanth.kvj is on a distinguished road

      0  

    Post


    Thanks Castitas.

    1. Yes reference that I'm using is id of the component.
    2. Im not using itemId and using xtype.

    Code:
    ----------
    items:[{
    xtype: 'container',
    autoEl: {
    tag: 'a',
    cls: 's-close',
    id: 'megamenuclose',
    html: ' ',
    title: 'Close'
    }
    }]

    Corresponding Html
    -----------------------------
    <a title="Close" class="s-close" id="megamenuclose"><div role="presentation" class="x-clear" id="container-1071-clearEl"></div>&nbsp;</a>

    Controller
    ------------
    '#megamenuclose': {
    afterrender: function (cmp) {
    cmp.getEl().on('click', this.closeMegaMenu);
    }
    }

  8. #8
    Sencha User castitas's Avatar
    Join Date
    Sep 2011
    Location
    US
    Posts
    116
    Vote Rating
    3
    Answers
    3
    castitas is on a distinguished road

      0  

    Default


    Quote Originally Posted by mitchellsimoens View Post
    this.control cannot resolve elements, just components
    http://www.sencha.com/forum/showthre...reference-link

    Does this help?
    word