This question is locked. New answers and comments are not allowed.
I am struggling with access to the view.params in the view.
My code is simple - and i just want to dynamically populate a data- element on a button that resides in the header with view.params. I want to do this without using the template or the data-show function as both of these don't seem to work.. Template doesn't seem to work with the header, and my attempt to do this in the js function called at data-show the button doesnt work properly.. PLEASED HELP!
<!-- 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="#=event_id#" data-user_id="view.params.user_id">Edit</a>
</div>
</header>
<div id="eventDetail"></div>
</div>
<script id="eventDetail-template" type="text/x-kendo-template">
<div id="eventData">
<p>
Type: ${type}
</p>
<p>
Loc: ${loc}
</p>
<p>
Date/Time: ${stamp}
</p>
<p>
Share this ${share}
</p>
</div>
</script>
My code is simple - and i just want to dynamically populate a data- element on a button that resides in the header with view.params. I want to do this without using the template or the data-show function as both of these don't seem to work.. Template doesn't seem to work with the header, and my attempt to do this in the js function called at data-show the button doesnt work properly.. PLEASED HELP!
<!-- 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="#=event_id#" data-user_id="view.params.user_id">Edit</a>
</div>
</header>
<div id="eventDetail"></div>
</div>
<script id="eventDetail-template" type="text/x-kendo-template">
<div id="eventData">
<p>
Type: ${type}
</p>
<p>
Loc: ${loc}
</p>
<p>
Date/Time: ${stamp}
</p>
<p>
Share this ${share}
</p>
</div>
</script>