I'm having a problem updating a Kendo Listview using a button.
The SubTasks_Read function is called in the code behind and returns data from wcf, but the listview doesnt change when i bind it.
Please help!!
Here is my code:
<div class="subtasks-div">
<div class="section-header">
<p>Subtasks</p>
</div>
@(Html.Kendo().ListView<Origin.Web.AdminProxy.SubTask>(Model.SubTaskList)
.Name("subtask-listView")
.TagName("div")
.ClientTemplateId("subtask-template")
.DataSource(dataSource =>
{
dataSource.Read(read => read.Action("SubTasks_Read", "WorkFlow"));
dataSource.PageSize(15);
})
.Selectable(selectable => selectable.Mode(ListViewSelectionMode.Single))
)
</div>
<script>
$(function () {
$("#refresh-button")
.button()
.click(function (event) {
var subTaskDataSource = new kendo.data.DataSource({
transport: {
read: {
type: "GET",
url: "../WorkFlow/SubTasks_Read/?taskId=2",
dataType: "jsonp"
},
},
schema: {
model: {
fields: {
subTaskId: { type: "number" },
taskId: { type: "number" },
subTaskName: { type: "string" },
subTaskOrder: { type: "number" }
}
}
}
});
$("#subtask-listView").kendoListView({
dataSource: subTaskDataSource
});
});
});