2

I'm trying to call a helper function when window.resize event is fired, but it is not happening.

afterRender : function(component,event,helper){
    this.superAfterRender();
    //window.addEventListener("resize", helper.onRender(component,event));
    window.onresize = function(component,event,helper){
        helper.onRender(component,event,helper);
    }
}
3

According to Custom renderer afterRender function accepts two, not three parameters

afterRender: function (component, helper) {
    this.superAfterRender();
    // interact with the DOM here
}

So, you need to change your code as following:

afterRender : function(component, helper){
    this.superAfterRender();
    //window.addEventListener("resize", helper.onRender(component));
    window.onresize = function(component,helper){
        helper.onRender(component);
    }
}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.