or
<!-- Event Page !!! Inherit the layout just above for footer and header --> <div data-role="view" data-layout="overview-layout" data-show="initEvent" id="event"> <div data-role="content" class="content"> <div id="eventContent"></div> <div> <div id="friendsToInvite"></div> </div> </div> </div> <script id="friendsToInvite-template" type="text/x-kendo-template"> <p>#= name #</p> <div style="width: auto; height: 180px; background: url('https://graph.facebook.com/#= fbid #/picture?type=large') no-repeat center;"></div> <p><button>Invite</button><button>Dont show me again</button></p> </script>var y = 3;function initEvent( e ){ //Get the "Key" of the event, which is linked to the id somehow var key = e.view.params.key; //Retrieve the event info from the cache with the key ! var event = Event.retrieveFromKey( key ); // Append the template of the event upon the event info var template = Handlebars.compile( $( '#eventTemplate' ).html() ); $( '#eventContent' ).prepend( template( event ) ); //The next ones are about getting your friend list for this specific event based on the algo // Generate an empty kendo Scroll View var friendsToInvite = new kendo.data.DataSource({ data: [] }); $( "#friendsToInvite" ).kendoMobileScrollView( { dataSource: friendsToInvite, template: $( "#friendsToInvite-template" ).html(), contentHeight: 300, enablePager: false }); $.when( Event.getFriendsList( event.id ) ).done( function( friendsList ) { if ( friendsList.length > 0 ) { for ( var i = 0; i < y; i++ ) { friendsToInvite.add( { name: friendsList[i]["name"], fbid: friendsList[i]["fbid"] } ); }; $( "#friendsToInvite" ).data("kendoMobileScrollView").setDataSource(friendsToInvite); // y++; // console.log(y); // if (y > 5) { // console.log("refresh"); // console.log ( scrollview ); // $( "#friendsToInvite" ).data("kendoMobileScrollView").setDataSource(friendsToInvite); // scrollview.refresh(); // $( "#friendsToInvite" ).empty(); // }; // console.log(friendsToInvite); // $( "#friendsToInvite" ).kendoMobileScrollView( // { // dataSource: friendsToInvite, // template: $( "#friendsToInvite-template" ).html(), // contentHeight: 300, // enablePager: false // }); } else { console.log("Got to be creative on this one ...") } });}01.{02. "items" : [03. ....04. ....05. ....06. {07. "fileName": "Pragmatic Bookshelf - CoffeeScript.Jul.2011.ENG.pdf",08. "folderPath": "I:\\eBooks",09. "absolutePath": "I:\\eBooks\\Pragmatic Bookshelf - CoffeeScript.Jul.2011.ENG.pdf",10. "size": {11. "bytes": 3573254,12. "MBytes": 3.4113. },14. "mtime": {15. "UTC": "\/Date(1315848420988)\/",16. "shortDate": "12.09.2011"17. }18. },19. ....20. ....21. ....22. ],23. "totalItems": 54024.}01.dataSource({02. transport: {03. ....04. },05. schema : {06. data: "items",07. total : function(data) {08. // if pagination is enabled - it won't work 09. // without declaring this function10. return data.totalItems;11. }12. }13.});$.Deferred(function(){ var promise = this; timer = setInterval(function() { if ($("#my-drawer:not(:visible)")[0]) { clearInterval(timer); promise.resolve(); } }, 100);})<?php if ($customers) { ?><?php foreach ($customers as $customer) { ?><li> <h3 class="time"><?php echo $customer['date_added']; ?></h3> <h3><?php echo $customer['name']; ?></h3> <a data-role="button" data-rel="external" style="float: right;" href="mailto:<?php echo $customer['email']; ?>" data-icon="compose">Email</a> <p><small><?php echo $column_email; ?>: <?php echo $customer['email']; ?></small></p> <p><span><b><?php echo $customer['status']; ?></b></span></p></li><?php } ?><?php } else { ?><li> <h2><?php echo $text_no_results; ?></h2></li><?php } ?>