title: Dropdown bootstrap after <g:remotelink> / Ajax call in Grails
body: <p>I am working on a Grails project where I have this dropdown:</p>
  
  <pre><code>&lt;li class="dropdown"&gt;
  &lt;a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false" &gt;${category.getName()} &lt;span class="caret"&gt;&lt;/span&gt;&lt;/a&gt;
      &lt;ul class="dropdown-menu" role="menu"&gt;
          &lt;li&gt;
          &lt;g:remoteLink controller="todo" action="getTodos" update="dynamic" method="GET" id="${category.id}" onSuccess="dynamics()"&gt;Ver
                      &lt;/g:remoteLink&gt;
      &lt;/li&gt;
              &lt;li&gt;&lt;a href="#"&gt;Modificar&lt;/a&gt;&lt;/li&gt;
              &lt;li&gt;&lt;a&gt;Eliminar&lt;/a&gt;&lt;/li&gt;
      &lt;/ul&gt;
  &lt;/li&gt;
  </code></pre>
  
  <p>and this function on JS:</p>
  
  <pre><code>function dynamics(){
      $("#dynamic").addClass("dynamicSet").removeClass("dynamicBefore");
      $(".dropdown-toggle").dropdown();
  }
  </code></pre>
  
  <p>The problem is: After the ajax call, the jscode <code>$(".dropdown-toggle").dropdown();</code> the dropdown works normally but after performing another ajax call right after, the dropdown collapses and won't work unless I reload the whole page.</p>
  
  <p>Anyone knows how to fix this problem
  Thanks in advance.                       </p>