title: data management in "Skate Warehouse" (HTML5/JS DevExtreme)
body: <p>I'm testing the Demo sample "Skate Warehouse" (HTML5/JS DevExtreme).
  Where does the app get the data for Products.js ?
  Can I instead read the information from a text file and display it in products?</p>
  
  <p>Products.js:</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>window.DXSK8 = window.DXSK8 || {};
  window.DXSK8.Store = window.DXSK8.Store || {};
  window.DXSK8.Store.db = window.DXSK8.Store.db || {};
  
  (function () {
      var db = {},
          TypeIds = {
              deck: "74C9F584-429F-4F5B-8A9F-007D6176D6E4",
              truck: "2D7D4288-E1D1-4116-AEEE-056EF87C011E",
              wheels: "3182DE2E-417D-4B1F-9E6D-1CB073DC5A04"
          }
  
      db.loadProduct = function(id, success, fail) {
          return DXSK8.db.Products.load({
              select: [
                  "ID",
                  "Name",
                  "Price",
                  "Quantity",
                  "ImageUrl",
                  "Brand.Name"
              ],
              filter: ["ID", new DevExpress.data.Guid(id)]
          }).done(function (product) {
              product = mapProduct(product[0]);
              success.call(this, product);
          }).fail(fail);
      };
  
      db.loadProducts = function(type, success, fail) {
          DXSK8.db.Products.load({
              select: [
                  "ID",
                  "Name",
                  "Price",
                  "Quantity",
                  "ImageUrl",
                  "Brand.Name"
              ],
              filter: ["Type.ID", new DevExpress.data.Guid(TypeIds[type])]
          }).done(function (products) {
              products = $.map(products, mapProduct);
              DevExpress.data.query(products)
                  .groupBy("brandName")
                  .enumerate()
                  .done(function (products) {
                      success.call(this, products);
                  })
  
          }).fail(fail);
      };
  
      function mapProduct(product) {
          var result = {
              id: product.ID,
              image: product.ImageUrl,
              name: product.Name,
              price: parseFloat(product.Price),
              quantity: product.Quantity,
              brandName: product.Brand.Name
          }
          return result;
      }
  
  
  
      $.extend(DXSK8.Store.db, db);
  })();</code></pre>
  </div>
  </div>
  </p>