3

I tried to explore this example on dojo And then, I just noticed these lines of code:

      dataSource: {
            data: products,
                schema: {
                    model: {
                       fields: {
                            ProductName: { type: "string" },
                            UnitPrice: { type: "number" },
                            UnitsInStock: { type: "number" },
                            Discontinued: { type: "boolean" }
                        }
                     }
                 },

I tried to delete the whole schema thing and it works just fine. It doesn't affect the columns and fields and even the loading performance.

Now I wonder the purpose of that thing. I do some quick research, and I found nothing specific.

dr.Crow
  • 1,493
  • 14
  • 17
  • `fields` and `model` can have non-default configuration, and many other settings. Even in your case deleting `schema` yields to different result, it's just not obvious. Note, type "boolean" and check what is the default type for the field. – dfsq Nov 10 '15 at 06:46
  • In their example, i added a boolean field. and I can still change it's format to check field using template like `{ field: "Discontinued", template: '' }`. it just doesn't make sense to me if why do we need to add that '`schema` codes' if you can achieve the same thing without it. – dr.Crow Nov 10 '15 at 06:56

0 Answers0