0
我在使用按鈕更新Kendo Listview時遇到問題。
SubTasks_Read函數在後面的代碼中調用,並從wcf返回數據,但是當我綁定它時,listview不會改變。 請幫忙!!Kendo Listvew不能更新/刷新
這裏是我的代碼:
<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
});
});
});