lundi 7 avril 2014

Documentation for object-literal based configs

I am learning ExtJS. It appears very heavy on "config" objects, most of which are object literals. These configuration objects do not appear in Sencha Docs, as far as I can see.



Example:



I follow a tutorial on creating a store and populating it via an Ajax proxy. The proxy configuration is displayed like so:





proxy: { type: 'rest', url: '/api/option/colors' reader: { type: 'json', root: 'data', totalProperty: 'count' }}(This is a configuration object specified in the definition of a class extending Ext.data.Store.)



According to this document at SenchaDocs, the "proxy" config can be one of 3 types: a String, an Ext.data.proxy.Proxy, or an Object. Here, we are clearly using an Object. The keys specified do not appear in the documentation for an Ext.data.proxy.Proxy and the links to "String" and "Object" are irrelevant, showing only general information about their meaning.



How are beginners expected to understand these configurations and learn the possible options and values? Where is the documentation for the "type" option for a proxy defined as an object (like above)? Where is the documentation for the "type" option for a reader defined as an object? What values are available? What do those values actually mean?




Aucun commentaire:

Enregistrer un commentaire