Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Kendo ListView: cant refresh (reload) data

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?

like image 654
user2265414 Avatar asked Apr 18 '13 11:04

user2265414


1 Answers

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();
like image 155
Samuel Caillerie Avatar answered Sep 19 '22 23:09

Samuel Caillerie