2

Is it possible to automatically re-render a widget after the number of columns is changed? I have a widget that has to be re-rendered/re-executed after the widget columns change and I don't know how to realize it.

I can't just make a javascript event like $(window).resize() because I already have this function and check if the client client height changes there because otherwise it would trigger every second for no reason.

2

I found an answer that works for me at least.. Since I render my widget via Javascript and not via PHP/Twig I can use this

$(document).on("click", ".colspan-picker a", function(){
    var container = $(this).parent().parent().parent();
    widgetID = container.data("id");
    sRGoogleAnalyticsRerenderChart(widgetID);
});

.colspan-picker a is the element for columnchange and its parent().parent().parent() has a data-id of the widget container

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.