0 Replies Latest reply: Dec 10, 2014 11:18 AM by Danny Callaghan RSS

    DIV-tag Integration in a SPA

      Hello


      Excuse my ignorance, I’m very new to Qlik. How can I add div tag integration in a single page application?


      My current set up is this:

      - The QvAjax.js file is referenced in my index file (along with my other JavaScript files required for my application).

      - One of the routes (let’s say reports.html) contains the following code:

       

           
      

      <div avqview="Cases"

          avq="object:.Document\CH01"

          id="Document\CH01"

          view="Cases"

          >

      </div>

            

      <script>

          Qv.InitWorkBench({

              View: 'Cases',

              Host: null

          });

      </script>

       

      When I hit reports.html (by clicking on Reports in my nav) the Qlik document loads perfectly inside the DIV, inside my application. Brilliant.


      HOWEVER, if I then navigate to another route, then return to Reports, no Qlik document is loaded (and no errors).


      Similarly, if I have two different Qlik documents, called within two different routes (let’s say Reports and Graphs), the first one will load, the second will not (and it makes no difference *which* one is chosen first.


      As a single page application, I can *kinda* understand what’s happening - Qlik is doing it’s thing on page load and the initial call to the InitWorkBench, but from then on, it feels it’s done it’s job and doesn’t call it again (until I refresh the page), but there must be some way around this. I have gone through the… er… interesting QvAjax.js file to look for some kind of reinitialize, or destroy method, but with no luck.


      Any ideas how I can get around this issue? It’s almost 2015 - we can’t be the only ones trying to integrate Qlik with a SPA!


      Thanks