在kendo网格中,如何知道ajax函数何时开始和结束?

时间:2012-11-16 11:03:43

标签: asp.net-mvc razor kendo-ui

在我的网格中,我想在kendo网格触发ajax请求时调用javascript函数。当ajax请求结束时,我需要触发另一个javascript函数。 代码:

@(Html.Kendo()
    .Grid<Aditro.Foundation.Dashboard.Web.Models.Link>()
.Name("LinkGrid")
.Columns(columns =>
{
    columns.Bound(c => c.Text).Width(100);
    columns.Bound(c => c.Url).Width(250);
    columns.Command(command => { command.Edit(); command.Destroy(); }).Width(100);
})
.DataSource(source =>
{
    source.Ajax().Read(read => read.Action("GetLinks", "Settings").Data("Grid_OnComplete"))
        .Create(read => read.Action("LinkAddEdit", "Settings"))
        .Events(e => e.RequestStart("callloading"))
        .Update(read => read.Action("LinkAddEdit", "Settings"))
        .Destroy(read => read.Action("LinkDelete", "Settings"))
        .Model(model => { model.Id("LinkId"); model.Field(x => x.Genus_List_Action).Editable(true); model.Field(x => x.Genus_List_Select).Editable(false); });
})
.ToolBar(toolbar => toolbar.Create())
.Pageable(pageable =>
{
    pageable.Enabled(true);
    pageable.PageSizes(new[] { 5, 10, 15, 20, 25 });
})
.Editable(editable => editable.Mode(GridEditMode.InLine))
.Navigatable()
.Selectable(action => action.Mode(GridSelectionMode.Single))
//.Filterable()
.Sortable(sort => sort.SortMode(GridSortMode.MultipleColumn))
.Resizable(resizable => resizable.Columns(true))

)

由于

1 个答案:

答案 0 :(得分:0)

您需要升级到公开RequestEnd事件的新版本。