Hello,
I'm trying to have my ListView working with Pull To Refresh. Nevertheless, I can't have the listview refresehd.
basically, when a user trigger pull to refresh, it should replace the whole content of the list view.
Here is how I have handled my list view and the pull to refresh:
$.when( Event.getEventsNearby( position.coords.latitude, position.coords.longitude, radius, limit, offset, key ) ).done( function( response ) { var dataToBeCached = new Array(); //In order not to cache the same results twice var previousContent; if( response.containsResults ) { var results = response.results; //On chope le nombre de resultats. Si !=limit, il y a de grandes chances qu'il n'y ai plus de resultats par la suite. // resultLength = data.length; // //On progresse dans les resultats // //Et on adapte offset et limit // offset += resultLength; // limit = offset + 20 ; //Merge the previous content with the new one // previousContent = JSON.parse( getItem("contentEvent") ); // if ( previousContent != null ) // { // var dataToBeCached = dataToBeCached.concat(previousContent); // }; //Remove previous markers Map.clearMarkers(); // Add Markers on the map Map.setMarkerPosition( position.coords.latitude, position.coords.longitude, "grey" ); for ( var i=0; i<results.length; i++ ) { Map.setMarkerPosition( results[i].lat, results[i].lng, "green"); results[i]["index"] = i; } setItem("events", JSON.stringify( results ), 1); var template = Handlebars.compile( $( '#eventListTemplate' ).html() ); $("#list-container").kendoMobileListView({ template : template, dataSource: kendo.data.DataSource.create(results), fixedHeaders: false, pullToRefresh: true, pullParameters: function(item) { console.log("pull"); //Here, another AJAX call to get the new results $.when( Event.getEventsNearby( position.coords.latitude, position.coords.longitude, radius, limit, offset, key ) ).done( function( response ) { console.log("when"); //I can see I'm getting my results properly here. console.log(response.results); //Doesn't work ... return response.results; }); } }); //We remove those fucking classes added by default with Kendo UI // $("#list-container").removeClass("km-widget km-listview km-list"); // $(".post-actions [data-role='button']").removeClass("km-widget km-button"); $( document ).trigger( "wallReady" ); //Retrieve the different user conversations: updateListOfChats(); }});What should I put into the pullParameters function to make it work ? Thanks.