【发布时间】:2015-05-29 10:43:59
【问题描述】:
我是 DevExpress 的新手。我正在 Devextreme 多通道应用程序中开发移动应用程序。
我有一个 mssql 数据库,该数据库通过 WCF ODataService 连接到移动应用程序。当向 mssql 添加项目时,必须推送通知。我该怎么做?
【问题讨论】:
标签: notifications push-notification devexpress push devextreme
我是 DevExpress 的新手。我正在 Devextreme 多通道应用程序中开发移动应用程序。
我有一个 mssql 数据库,该数据库通过 WCF ODataService 连接到移动应用程序。当向 mssql 添加项目时,必须推送通知。我该怎么做?
【问题讨论】:
标签: notifications push-notification devexpress push devextreme
我想您使用 DataSource 和 ODataStore 来访问您的 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 guide 中找到有关在 DevExtreme 应用程序中处理数据的有用信息。
【讨论】: