or
<!-- my view --><div id="status-container" class="user-status-wrp cf" data-role="listview" data-style="inset"> <div class="recipe-content"> <h2 id="recipeName" class="recipe-name" data-bind='text: Name'></h2> <span id="activityDate" class="time-span" data-bind="text: CreatedAtFormatted"></span> <ul data-bind="source: " data-template="elementsTemplate" data-role="listview" data-style="inset"> </ul> </div></div><!-- my template --><script type="text/x-kendo-template" id="elementsTemplate"> <li data-role="touch">#:Id#</li></script>/** * Recipes view model */var app = app || {};app.Recipes = (function () { 'use strict' // Recipes model var recipesModel = (function () { var recipeModel = { id: 'Id', fields: { Name: { field: 'Name', defaultValue: '' }, CreatedAt: { field: 'CreatedAt', defaultValue: new Date() }, Elements : { field: 'Elements', defaultValue: '', type: 'relation' } }, CreatedAtFormatted: function () { return app.helper.formatDate(this.get('CreatedAt')); } }; // DataSource by Everlive var recipesDataSource = new kendo.data.DataSource({ type: 'everlive', schema: { model: recipeModel }, transport: { // Nom du Model typeName: 'Recipes' }, change: function (e) { if (e.items && e.items.length > 0) { $('#no-span').hide(); } else { $('#no-span').show(); } }, sort: { field: 'Name', dir: 'asc' } }); return { recipes: recipesDataSource }; }()); // Recipes view model var recipesViewModel = (function () { //Affichage d'une recette var recipeSelected = function (e) { app.mobileApp.navigate('views/recipeView.html?uid=' + e.data.uid); }; return { recipes: recipesModel.recipes, recipeSelected: recipeSelected, }; }()); return recipesViewModel;}());