title: Backbone.marionette: jQuery document.ready not running on route
body: <p>So I have a web application that routes from the login button to a dashboard where I run an <code>initialize()</code> function, which contains a <code>document.ready()</code> block. The problem is, that on the backbone <code>route</code> it seems like the <code>document.ready()</code> block isn't being run. Here some code to clearify: </p>
  
  <p>Here's an event from my landing page view:</p>
  
  <pre><code>events:
      'click .pure-menu .signin': 
        () -&gt;
          application.router.navigate('dash', {trigger: true})
  </code></pre>
  
  <p>That then routes the application to my dashboard view: </p>
  
  <pre><code>module.exports = class DashView extends Backbone.Marionette.ItemView
      id: 'dash-view'
      template: template
  
      initialize: -&gt;
  
          $ -&gt;
              $(".gridster ul").gridster(
                  widget_margins: [10, 10]
                  widget_base_dimensions: [140, 140]
              )
  </code></pre>
  
  <p>Where I have a jQuery <code>document.ready()</code> block with some code to be run once the dom is loaded. </p>
  
  <p>I'm using the <a href="http://gridster.net/" rel="nofollow">Gridster</a> library, but when the page routes this code does not get run, because the Gridster grids don't get initialized. </p>
  
  <p>When I refresh the page every thing works as expected.</p>
  
  <p>My guess it that when the page routes, jQuery doesn't get the "dom loaded" event, so therefore the block doesn't get executed? I'm not sure. Any help would be appreciated.</p>
  
  <p>And to solve using a hack, does anyone know how to route in backbone with a page refresh?</p>