Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>The best method i have found so far (access view parameters in view) is to use the Kendo ViewModel method - MVVM - and the template - pulling in the view.params from a querystring click:</p> <pre><code> &lt;a data-role="button" href="#view-Home?userID=2&amp;userType=1&amp;trainerID=2"&gt; </code></pre> <p>Then call a script via the data-show or data-init method of the view and bind the viewModel: </p> <pre><code>&lt;!-- =========================================================================================== Home page --&gt; &lt;div data-role="view" id="view-Home" data-title="Home" data-show="checkAuth" data-model="home_viewModel" &gt; &lt;div id="homeWrapper"&gt; &lt;div id="myTrainerInfo" data-template="myTrainerIcon-template" data-bind="source: user_info" &gt;&lt;/div&gt; &lt;/div&gt; &lt;!-- ========================================================================================= Home script --&gt; &lt;script&gt; //init the viewmodel var home_viewModel = kendo.observable({ user_info: [] }); function checkAuth(e) { var userID = e.view.params.userID; var userType = e.view.params.userType; var trainerID = e.view.params.trainerID; var userData = {userID:userID,userType:userType,trainerID:trainerID}; //set the viewmodel data home_viewModel.set("user_info", userData); } &lt;/script&gt; </code></pre> <p>The vars can then be accessed via ${var_name} or via HTML data-bind="value: var_name":</p> <pre><code> &lt;!-- ============================================================================== myTrainerIcon template --&gt; &lt;script id="myTrainerIcon-template" type="text/x-kendo-template"&gt; &lt;div id="myTrainerIcon" class="homePageIcons"&gt; &lt;a data-role="button" href="\\#view-trainerDetail?user_id=${userID}&amp;amp;trainer_id=${trainerID}"&gt; &lt;img src = "styles/icons/myTrainerICON.png" alt="myTrainer" /&gt; &lt;/a&gt; &lt;div class = "icon-text" &gt;myTrainer&lt;/div&gt; &lt;/div&gt; &lt;div&gt;TrainerID: &lt;input name="edit_id" id="edit_id" data-min="true" class="k-input" data-bind="value: trainerID" type="text" /&gt;&lt;/div&gt; &lt;/script&gt; </code></pre> <p>Im sure there is a different way to do this but so far nothing i have discovered on my own..</p>
    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. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      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