Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- the template
- <script type="text/x-kendo-template" id="templateForCategoryList">
- <a href="pgArticles?categoryid=${Id}" >
- <img src="${imgPath}" class="publicationImage" />
- ${Text}
- </a>
- </script>
- the view
- <!-- all articles in that publication -->
- <div data-role="view" data-layout="main-layout" id="pgArticles"
- data-show="loadArticles"
- data-title="Articles">
- <ul data-role="listview" id="uxArticleList" ></ul>
- </div>
- the load javascript thing..
- function loadArticles(e){
- var params = e.view.params;
- var id = params["categoryid"];
- //alert(id);
- renderData('articles' , '#uxArticleList', 'templateForArticleList','&categoryid=' + id);
- }
- the render method
- function renderData(type , bindingTarget, idOfemplateToUse,whereClause){
- var url = getDataUrlFor(type,true,whereClause);
- // alert(url);
- var ds = new kendo.data.DataSource.create({
- transport: {
- // read from the remote data source
- read: {
- url : url,
- type : 'GET',
- dataType : 'jsonp',
- crossDomain : true
- }
- }
- });
- // alert ( ds);
- $(bindingTarget).kendoMobileListView({
- dataSource: ds,
- template: kendo.template($(idOfemplateToUse).html())
- });
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement