Do I have to create a new panel for every page?

后端 未结 11 1483
Happy的楠姐
Happy的楠姐 2020-12-13 22:30

I would like to use a Panel in a jqm site for my Choose Language component. So that component will need to be present on every page. Here is the setup for a single-page pane

11条回答
  •  我在风中等你
    2020-12-13 23:24

    My approach is similar to other answers here but sufficiently different to warrant a post.

    In my multipage project I build my nav panel in the first page like so:

    And then in subsequent pages I add a div with a suitable classname to identify it:

    And then on the pagebeforecreate event of the first page of the app I clone the nav panel and replace all the child containers with it:

    $(document).delegate("#index", "pagebeforecreate", function () {
    
                var navpanelCopy = $( "#nav-panel" ).clone();
                $( ".navPanelChild" ).replaceWith(navpanelCopy);
    
                }); 
    

提交回复
热议问题