Note that there are some explanatory texts on larger screens.

plurals
  1. POInject some buttons in my header specific to the current view with durandal
    primarykey
    data
    text
    <p>I develop an ASP.NET MVC solution with the <strong>Durandal framework</strong>. </p> <p>On the shell page, I have the side bar (which contains my main menu) and also the header bar. This header bar contains button specific to the current view.</p> <p>So for example, if I display a search view, I need to 'inject' specific button in the header bar like 'Search' or 'Reset' buttons.</p> <p>Another example, if I display a detail view, I need to 'inject' specific button in the header bar like 'Save' or 'Cancel' buttons.</p> <p><strong>My question</strong>: how to proceed to be able to 'inject' some html elements (buttons) in my header bar specifically for the current view?</p> <p>Maybe I need to refactor my shell to code my header bar somewhere else?</p> <p>Below is an extract of my shell page:</p> <pre><code>&lt;div class="page secondary with-sidebar"&gt; &lt;div id="header"&gt; .... &lt;/div&gt; &lt;!--header--&gt; &lt;div class="page-sidebar"&gt; .... &lt;/div&gt; &lt;div class="page-region"&gt; &lt;div class="page-region-content"&gt; &lt;div class="grid"&gt; &lt;div class="row"&gt; &lt;div class="container-fluid page-host"&gt; &lt;!--ko compose: { model: router.activeItem, //wiring the router afterCompose: router.afterCompose, //wiring the router transition:'fade', //use the 'fade' transition when switching views cacheViews:true //telling composition to keep views in the dom, and reuse them (only a good idea with singleton view models) }--&gt;&lt;!--/ko--&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; &lt;!--grid--&gt; &lt;/div&gt; &lt;!--page-region-content--&gt; &lt;/div&gt; &lt;!--page-region--&gt; &lt;/div&gt; &lt;!--page secondary--&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload