2015-05-29 156 views
1

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

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

回答

1

我想你使用数据源ODataStore访问您的OData服务。如果添加使用ODataStore.insert()方法的项目,你可以在ODataStore 插入事件处理

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"); 
    } 
}); 

内或回调插入(方法

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

参见this jsfiddle

您还可以找到在this guide在DevExtreme应用数据的工作有用的信息。

+0

感谢维克多,但我问我该怎么办推送通知在Devextreme移动应用 –

+1

不幸的是,DevExtreme不提供此功能。我认为你需要使用适当的[PhoneGap](https://github.com/phonegap-build/PushPlugin)插件。请参阅[本教程](http://devgirl.org/2013/07/17/tutorial-implement-push-notifications-in-your-phonegap-application/)。 –

+0

您是否看过像Signal-R这样的服务将数据从服务推送到客户端(DevExtreme应用程序)? – Brendon