db.js 776 B

12345678910111213141516171819202122232425262728
  1. (function () {
  2. var endpointSelector = new DevExpress.EndpointSelector(Partials.config.endpoints);
  3. var serviceConfig = $.extend(true, {}, Partials.config.services, {
  4. db: {
  5. url: endpointSelector.urlFor("db"),
  6. errorHandler: handleServiceError
  7. }
  8. });
  9. function handleServiceError(error) {
  10. if (window.WinJS) {
  11. try {
  12. new Windows.UI.Popups.MessageDialog(error.message).showAsync();
  13. } catch (e) {
  14. // Another dialog is shown
  15. }
  16. } else {
  17. alert(error.message);
  18. }
  19. }
  20. // Enable partial CORS support for IE < 10
  21. $.support.cors = true;
  22. Partials.db = new DevExpress.data.ODataContext(serviceConfig.db);
  23. }());