【问题标题】:How can I catch web api return message on Devextreme datagrid?如何在 Devextreme 数据网格上捕获 web api 返回消息?
【发布时间】:2018-07-02 23:03:45
【问题描述】:

我在我的 Asp.Net MVC 项目中使用 DevExpress MVC DataGrid,我想知道如何在客户端捕获事件,例如在插入或更新一行之后。

请参阅下面的示例代码:

    @(Html.DevExtreme().DataGrid().ID("MyId").DataSource(d => d.WebApi().Controller("MyWebApi").Key("MyTableId")
........

【问题讨论】:

    标签: c# asp.net-mvc datagrid devextreme devexpress-mvc


    【解决方案1】:

    您可以使用以下描述的事件:

        .OnEditingStart(@<text> function(e) { logEvent("EditingStart"); } </text>)
        .OnInitNewRow(@<text> function(e) { logEvent("InitNewRow"); } </text>)
        .OnRowInserting(@<text> function(e) { logEvent("RowInserting"); } </text>)
        .OnRowInserted(@<text> function(e) { logEvent("RowInserted"); } </text>)
        .OnRowUpdating(@<text> function(e) { logEvent("RowUpdating"); } </text>)
        .OnRowUpdated(@<text> function(e) { logEvent("RowUpdated"); } </text>)
        .OnRowRemoving(@<text> function(e) { logEvent("RowRemoving"); } </text>)
        .OnRowRemoved(@<text> function(e) { logEvent("RowRemoved"); } </text>)
    

    你可以看到它在这个demo from DevExpress上工作

    【讨论】:

      【解决方案2】:

      official DevExtreme demo 说明了如何使用 WebAPI 实现 CRUD 操作

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2014-05-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2020-08-05
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多