【问题标题】:Devextreme push notificationDevextreme 推送通知
【发布时间】:2015-05-29 10:43:59
【问题描述】:

我是 DevExpress 的新手。我正在 Devextreme 多通道应用程序中开发移动应用程序。

我有一个 mssql 数据库,该数据库通过 WCF ODataService 连接到移动应用程序。当向 mssql 添加项目时,必须推送通知。我该怎么做?

【问题讨论】:

    标签: notifications push-notification devexpress push devextreme


    【解决方案1】:

    我想您使用 DataSourceODataStore 来访问您的 OData 服务。如果您使用 ODataStore.insert() 方法添加项目,您可以在 ODataStore inserted 事件处理程序中显示通知

    var odataStore = new DevExpress.data.ODataStore({
        url: "http://sampleservices.devexpress.com/Northwind.svc/Products",
        key: "ProductID",
        keyType: "Guid",
        onInserted: function(){
            DevExpress.ui.notify("Item inserted");
        }
    });
    

    或在 insert() 方法的 done 回调中

    odataStore.insert({
        ProductName: 'Some name',
        CategoryID: 1,
        . . .
    }).done(function(){
        DevExpress.ui.notify("Item inserted");
    })
    

    this jsfiddle

    您还可以在this guide 中找到有关在 DevExtreme 应用程序中处理数据的有用信息。

    【讨论】:

    • 感谢 Victor,但有人问我如何在 Devextreme 移动应用程序中进行推送通知
    • 不幸的是,DevExtreme 确实提供了这个功能。我认为您需要使用适当的PhoneGap 插件。见this tutorial
    • 您是否看过 Signal-R 之类的东西来将数据从服务推送到客户端(DevExtreme 应用)?
    猜你喜欢
    • 2017-12-23
    • 1970-01-01
    • 2018-02-17
    • 2021-06-11
    • 1970-01-01
    • 2015-05-12
    • 1970-01-01
    相关资源
    最近更新 更多