Kendo ListView: cant refresh (reload) data

user2265414 picture user2265414 · Apr 18, 2013 · Viewed 14.3k times · Source

Here is my ListView:

@(Html.Kendo().ListView<Entity>()
  .Name("listView")
  .TagName("div")
  .ClientTemplateId("template")
  .DataSource(dataSource => {
      dataSource.Read(read => read.Action("Products_Read", "Home").Data("additionalData"));
      dataSource.PageSize(4);

})
.Pageable()   
)

Here are javascript function that must reload data:

var someData = "-1";
function reload() {
   // insure that function exists
   // alert( $("#listView").data("kendoListView").refresh)
   $("#listView").data("kendoListView").refresh();

}

function additionalData() {
    return {
        someData:  someData
    };
}

I do all as written in documentation but doesnt see any postback.Whats wrong?

Answer

Samuel Caillerie picture Samuel Caillerie · Apr 18, 2013

refresh() (see refresh) only refreshes data on screen but don't reload data. If you want to do so, you have to use read() :

$("#listView").data("kendoListView").dataSource.read();