I have a a basic kendo view and am wondering if there is a way to access the view.params without using the data-show or data-init to run a js OR if i do use the current functon call on data-show how can i dynamically populate the data elements of my EDIT button?
<!-- eventDetail view -------------------------------------------------------------------------------------------------->
<div data-role="view" id="view-eventDetail" data-show="getEventDetailData" data-title="eventDetail">
<header data-role="header">
<div data-role="navbar">
<span data-role="view-title"></span>
<a data-align="left" data-role="button" class="nav-button" href="#view-myEvents">Back</a>
<a data-align="right" data-role="button" class="nav-button" data-click="showEventUpdate" data-event_id="view.params.event_id" data-user_id="view.params.user_id">Edit</a>
</div>
</header>
<div id="eventDetail"></div>
</div>
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:
Then call a script via the data-show or data-init method of the view and bind the viewModel:
The vars can then be accessed via ${var_name} or via HTML data-bind=”value: var_name”:
Im sure there is a different way to do this but so far nothing i have discovered on my own..