This is a migrated thread and some comments may be shown as answers.

ListView Won't Refresh

2 Answers 841 Views
ListView
This is a migrated thread and some comments may be shown as answers.
Graham
Top achievements
Rank 2
Iron
Iron
Graham asked on 03 Nov 2016, 05:33 PM

Here's my MVC ListView:

@(Html.Kendo().ListView<EntryExitBoard>()
    .Name("matrixEntryExitBoardLV")
    .DataSource(dataSource =>
    {
        dataSource.Read(read => read.Action("GetEntryExitBoard", "Warehouse").Data("getStartDepotNumber"));
    })
    .TagName("div")
    .ClientTemplateId("entryExitTemplate")
     .Selectable(selectable => selectable.Mode(ListViewSelectionMode.Single))
     .Events(events => events.Change("onEntryExitBoardChange"))
    )

 

It loads initially with no problem. But when the following code tries to refresh it...

 

var listView = $("#matrixEntryExitBoardLV").data("kendoListView");
listView.refresh();

 

It steps over the refresh without throwing an error, but the list view doesn't refresh.

 

2 Answers, 1 is accepted

Sort by
0
Nikolay Rusev
Telerik team
answered on 04 Nov 2016, 07:04 AM

Hello Graham,

Calling refresh method will re-read the data currently loaded in the dataSource and will repaint the widget. It is a common method for all data-driven widgets. 

Notice that it will not make a request for fresh data if that is what you expect.

Regards,
Nikolay Rusev
Telerik by Progress
Check out the new UI for ASP.NET Core, the most complete UI suite for ASP.NET Core development on the market, with 60+ tried-and-tested widgets, based on Kendo UI.
0
Graham
Top achievements
Rank 2
Iron
Iron
answered on 04 Nov 2016, 09:10 AM

Thanks Nikolay.

 

For future reference, the corrected JavaScript code is:

 

var listView = $("#matrixEntryExitBoardLV").data("kendoListView");
listView.dataSource.read();
Tags
ListView
Asked by
Graham
Top achievements
Rank 2
Iron
Iron
Answers by
Nikolay Rusev
Telerik team
Graham
Top achievements
Rank 2
Iron
Iron
Share this question
or