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);
    }
}

1 Answer 1

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);
    }
}
0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .