Page 1 of 2 12 LastLast
Results 1 to 10 of 16

Thread: Custom Render event does not fire???

  1. #1
    Sencha User
    Join Date
    Sep 2010
    Posts
    89
    Vote Rating
    0
      0  

    Default Custom Render event does not fire???

    hi, I just switched to Ext 4.1 beta, heard that 4.0 is no good.

    Now the render event does not fire anymore!!! Why


    Ext
    .define('My.awesome.Class', {
    extend: 'Ext.Component',

    initComponent: function(){
    alert('init')
    this.callParent();
    },


    render: function(){
    alert('render');
    this.callParent();

    },
    someMethod: function() { }

    }, function() {

    var myInstance = new this();
    });
    Ext.create('My.awesome.Class', {
    });?

  2. #2
    Sencha - Sr Software Engineer mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    39,414
    Vote Rating
    1269
      0  

    Default

    The render event or method?
    Mitchell Simoens @LikelyMitch
    Sencha Inc, Senior Software Engineer
    ________________
    Learn BBCode and use it!

    Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
    https://github.com/mitchellsimoens

    Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/

    Need more help with your app? Hire Sencha Services services@sencha.com

    Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is in print!

    When posting code, please use BBCode's CODE tags.

  3. #3
    Sencha User
    Join Date
    Sep 2010
    Posts
    89
    Vote Rating
    0
      0  

    Default

    The render event.

    If you run the dummy component, the render event did not fire.

    Thanks for the reply

  4. #4
    Sencha - Sr Software Engineer mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    39,414
    Vote Rating
    1269
      0  

    Default

    This was a bug in beta 3 but the render events have been fixed for the next release.
    Mitchell Simoens @LikelyMitch
    Sencha Inc, Senior Software Engineer
    ________________
    Learn BBCode and use it!

    Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
    https://github.com/mitchellsimoens

    Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/

    Need more help with your app? Hire Sencha Services services@sencha.com

    Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is in print!

    When posting code, please use BBCode's CODE tags.

  5. #5
    Sencha - Sr Software Engineer mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    39,414
    Vote Rating
    1269
      0  

    Default

    Also in your code you aren't listening to any render event.
    Mitchell Simoens @LikelyMitch
    Sencha Inc, Senior Software Engineer
    ________________
    Learn BBCode and use it!

    Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
    https://github.com/mitchellsimoens

    Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/

    Need more help with your app? Hire Sencha Services services@sencha.com

    Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is in print!

    When posting code, please use BBCode's CODE tags.

  6. #6
    Sencha User
    Join Date
    Sep 2010
    Posts
    89
    Vote Rating
    0
      0  

    Default

    thanks.

    Should i go back to 4.0?

    what is the best practice to listen to the render event?

    isn't it enough to just do:

    render: function(){
    }

    the way initComponent does?

  7. #7
    Sencha - Sr Software Engineer mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    39,414
    Vote Rating
    1269
      0  

    Default

    You can use a template method instead of using listeners. Of course if you ever use MVC events will be the preferred way but if you're not using MVC then it's up to the dev to choose to use the methods or events.
    Mitchell Simoens @LikelyMitch
    Sencha Inc, Senior Software Engineer
    ________________
    Learn BBCode and use it!

    Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
    https://github.com/mitchellsimoens

    Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/

    Need more help with your app? Hire Sencha Services services@sencha.com

    Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is in print!

    When posting code, please use BBCode's CODE tags.

  8. #8
    Sencha User
    Join Date
    Sep 2010
    Posts
    89
    Vote Rating
    0
      0  

    Default

    can you explain further? sorry i am not following

  9. #9
    Sencha - Sr Software Engineer mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    39,414
    Vote Rating
    1269
      0  

    Default

    So to listen for an event you can do this:

    Code:
    initComponent : function() {
        this.callParent();
    
        this.on('render', someFuncton, this, { single : true });
    }
    Or when you create the instance:

    Code:
    listeners : {
        single : true,
        render : someFunction
    }
    Or with MVC:

    Code:
    this.control({
        'somextype' : {
            render : this.someFunction
        }
    });
    Or you can use the template methods like render or afterRender.
    Mitchell Simoens @LikelyMitch
    Sencha Inc, Senior Software Engineer
    ________________
    Learn BBCode and use it!

    Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
    https://github.com/mitchellsimoens

    Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/

    Need more help with your app? Hire Sencha Services services@sencha.com

    Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is in print!

    When posting code, please use BBCode's CODE tags.

  10. #10
    Sencha User
    Join Date
    Sep 2010
    Posts
    89
    Vote Rating
    0
      0  

    Default

    Cool.

    I wish i could see more code samples like this. The blog is awesome

Page 1 of 2 12 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •