Answers.Body: <p>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</p>
  
  <pre><code>$(document).on("click", ".colspan-picker a", function(){
      var container = $(this).parent().parent().parent();
      widgetID = container.data("id");
      sRGoogleAnalyticsRerenderChart(widgetID);
  });
  </code></pre>
  
  <p><code>.colspan-picker a</code> is the element for columnchange and its <code>parent().parent().parent()</code> has a data-id of the widget container</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-10-06T07:25:25.083Z
Answers.LastActivityDate: 2016-10-06T07:25:25.083Z
Answers.UserDisplayName: Robin Schambach
Body: <p>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.</p>
  
  <p>I can't just make a javascript event like <code>$(window).resize()</code> 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.</p>
  
Tags: <plugin-development><dashboard-widgets>
Title: Re-render Widget after column number changes
ThreadText: # Re-render Widget after column number changes
  
  (Asked by: username_0 on 2016-10-05)
  
  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.
  
  **Tags:** plugin-development, dashboard-widgets
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_0 on 2016-10-06. Score: 2 | Accepted answer
  
  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
  
  
  ---
  
  