1

i have a listview of kendoui, when the page render, the listview show the data correctly, but when i change the datasource doesnt show the new data :/. here is my code. my listview.

Html.Kendo().ListView<CashControl.Models.cajeros>()
                            .Name("listView")
                            .TagName("div")
                            .ClientTemplateId("template")
                            .DataSource(ds=>
                                {
                                    ds.Read(read => read.Action("CajerosRead", "Monitoreo"));
                                    ds.PageSize(30);
                                }));

here is mi JS to change de datasource

$("#mapabutton").click(function () {
        alert(message);
        if (message != null) {
            var listview = $("#listView").data("kendoListView");
            var datasource = new kendo.data.DataSource({
                transport: {
                    read: {
                        url: "Monitoreo/Index",
                        dataType: "jsonp",
                        type: "POST",
                        data:{checkNodes: message}
                    }
                }
            });
            $("#listView").data("kendoListView").setDataSource(datasource);
            $("#listView").data("kendoListView").refresh();

            }
        });

here is the return data in JSON

{"Data":[{"idcajero":"1","estado":1,"tipo":"SmartPay","url":"glyphicons-halflings.png","nombre":"sp3","disp1":[{"nivelActual":120,"nivelMaximo":1000,"nombre":"MEI"},{"nivelActual":100,"nivelMaximo":1200,"nombre":"MEI"},{"nivelActual":159,"nivelMaximo":245,"nombre":"MEI"}]}],"Total":1,"AggregateResults":null,"Errors":null}

the return data is the same in the load page or the datasource change :/

Brakyo
  • 128
  • 2
  • 10
  • See this stackoverflow answer: [Kendo ListView: cant refresh (reload) data][1] [1]: http://stackoverflow.com/questions/16082300/kendo-listview-cant-refresh-reload-data – Tab May 12 '15 at 13:54

1 Answers1

0

I haven't dealt with KendoUI, but I have worked with several other Telerik controls.

They've all required that the datasource be set to null, then set to the new value. If I skipped the setting to null, it wouldn't update.

Brad Bruce
  • 7,638
  • 3
  • 39
  • 60