Kendo ListView: cant refresh (reload) data

2019-04-26 18:53发布

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?

1条回答
干净又极端
2楼-- · 2019-04-26 19:39

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();
查看更多
登录 后发表回答