title: jQuery Mobile Panel in static header
body: <p>Say I have a fairly complex menu in the JQM Panel that I need it to be accessible from every pages in the application. One way of implementing it is simply copy and paste the Panel code to each and every sub pages.</p>
  
  <p><a href="http://jsfiddle.net/FBkpt/" rel="nofollow">Approach 1 - The brutal way</a></p>
  
  <p>This worked. However, it is only good for a small application with simple panel.
  Copying the big chunk of Panel code and applying in every other pages can be quite cumbersome and surely suffer performance issue when more pages are loaded into DOM later.</p>
  
  <p>So I tried to do it another way - manipulating the Panel myself.
  I tapped into the <code>pagecreate</code> event and prepend the Panel into the page loaded.
  This way I can keep my DOM clean and always deal with one Panel at all time.</p>
  
  <p><a href="http://jsfiddle.net/FBkpt/1/" rel="nofollow">Approach 2 - The wishful way</a></p>
  
  <p>But that didn't work. It seemed the Panel failed to re-init themselves after I force-fully moving it from one page to another and call <code>pageContainer.trigger('refresh')</code> or <code>pageContainer.trigger('create')</code>.</p>
  
  <p>So I ended up doing this - keep the Panel html in js variable, then prepend the panel html into the page loaded, without removing the panel on previous page. This seem working.</p>
  
  <p><a href="http://jsfiddle.net/FBkpt/2/" rel="nofollow">Approach 3 - The compromise way</a></p>
  
  <p>While this approach doesn't really take care of that having only one Panel in the DOM, at least I don't have to copy-paste it into every pages.</p>
  
  <p>Now it works, but I'm not all that happy with it.
  I'm posting this question here and hopefully someone could shed some light explaining why the Approach 2 didn't work, and that would really make my day.</p>
  
  <p>** My app is using Multi-page template</p>
  
  <p>Cheers</p>