title: Does Extjs data Model/Store support any wrapper proxy builder method?
body: <p>We are using Extjs 5.x for building browser based single page application. Everything is working fine if simple model &amp; store used by us. If we are trying to use any wrapper for proxy it's generate error during runtime after having  <em>sencha cmd</em> build.</p>
  
  <p>Here is the simple Model of Article:</p>
  
  <pre><code>Ext.define('Pos.model.Article', {
      extend      : 'Ext.data.Model',
      alias       : 'widget.Article',
      idProperty  : 'id', 
      fields      : [
          { name : 'id',         mapping : 'id',         type : 'int'   },
          { name : 'code',       mapping : 'code',       type : 'string'},
          { name : 'name',       mapping : 'name',       type : 'string'},
          { name : 'rate',       mapping : 'rate',       type : 'float' },
          { name : 'expireDate', mapping : 'expireDate', type : 'date'  }
      ],
      proxy      :   {
          type            : 'rest',
          noCache         : true,
          limitParam      : 'limit',
          startParam      : 'start',
          url             : '/pos/article',
          reader          : {
              type            : 'json',
              rootProperty    : 'data',
              totalProperty   : 'total',
              successProperty : 'success',
              messageProperty : 'message',
              implicitIncludes: true
          },
          writer          :{
              type            : 'json',
              writeAllFields  : true 
          },
          simpleSortMode  : true
      }
  });
  </code></pre>
  
  <p>Here is the simple Store of Article:</p>
  
  <pre><code>Ext.define('Pos.store.Articles', {
      extend       : 'Ext.data.Store',
      model        : 'Pos.model.Article',
      idProperty   : 'id',
      autoLoad     :  false,
      autoSync     :  false,    
      remoteSort   :  true,
      remoteFilter :  true,
      pageSize     :  25,
      proxy        : {
          type            : 'rest',
          noCache         : true,
          limitParam      : 'limit',
          startParam      : 'start',
          url             : '/pos/article/store',
          reader          : {
              type            : 'json',
              rootProperty    : 'data',
              totalProperty   : 'total',
              successProperty : 'success',
              messageProperty : 'message',
              implicitIncludes: true
          },
          writer          :{
              type            : 'json',
              writeAllFields  : true 
          },
          simpleSortMode  : true
      },
      sorters      : [{
          property : 'name', 
          direction: 'ASC'
      }]
  });
  </code></pre>
  
  <p>When we are using simple model and store it working fine. But our goal was removing boiler plate of code for this reason we are trying to build some wrapper method to remove the redundant codes. Here is the simple wrapper of proxy builder for your consideration:</p>
  
  <pre><code>var Cki=Cki||{};
  
  ;Cki.proxy||(function($){
      var proxy = {
          $package      : 'Cki',
          $class        : 'Cki.proxy',
          resolveUrl    : function(action){
              var ctxPath = '/pos/',
                  url     = ctxPath + action;
  
              return url;
          },
          getReader           : function(){
              var reader  =  {
                      type            : 'json',
                      rootProperty    : 'data',
                      totalProperty   : 'total',
                      successProperty : 'success',
                      messageProperty : 'message',
                      implicitIncludes: true
                  };
              return reader;
          },
          getWriter           : function(){
              var writer =  {
                      type            : 'json',
                      writeAllFields  : true 
                  };
              return writer;
          },
          getRestProxy        : function(url, noCache){
              url     = (typeof url === 'undefined') ? '' : url;
              noCache = (typeof noCache === 'undefined') ? false : noCache;
              var restProxy    = {
                  type            : 'rest',
                  noCache         : noCache,
                  limitParam      : 'limit',
                  startParam      : 'start',
                  url             : proxy.resolveUrl(url),
                  reader          : proxy.getReader(),
                  writer          : proxy.getWriter(),
                  simpleSortMode  : true
              };    
              return restProxy;
          }
      };
      $.proxy = proxy;
  }(Cki));
  </code></pre>
  
  <p>Once the wrapper of proxy builder method is ready, we could use it for wrapping the proxy inside model and store. Here is the wrapped Proxy Model:</p>
  
  <pre><code>Ext.define('Pos.model.Article', {
      extend      : 'Ext.data.Model',
      alias       : 'widget.Article',
      idProperty  : 'id', 
      fields      : [
          { name : 'id',         mapping : 'id',         type : 'int'   },
          { name : 'code',       mapping : 'code',       type : 'string'},
          { name : 'name',       mapping : 'name',       type : 'string'},
          { name : 'rate',       mapping : 'rate',       type : 'float' },
          { name : 'expireDate', mapping : 'expireDate', type : 'date'  }
      ],
      proxy      :   Cki.proxy.getRestProxy('article')
  });
  </code></pre>
  
  <p>Here is the wrapped Proxy Store:</p>
  
  <pre><code>Ext.define('Pos.store.Articles', {
      extend       : 'Ext.data.Store',
      model        : 'Pos.model.Article',
      idProperty   : 'id',
      autoLoad     :  false,
      autoSync     :  false,    
      remoteSort   :  true,
      remoteFilter :  true,
      pageSize     :  25,
      proxy        :  Cki.proxy.getRestProxy('article/store'),
      sorters      : [{
          property : 'name', 
          direction: 'ASC'
      }]
  });
  </code></pre>
  
  <p>It's generate following error during runtime:</p>
  
  <ol>
  <li><em>Synchronous XMLHttpRequest on the main thread is deprecated because of its detrimental effects to the end user's experience. For more help, check <a href="https://xhr.spec.whatwg.org/" rel="nofollow">https://xhr.spec.whatwg.org/</a>.</em></li>
  <li><em><a href="http://localhost/pos/static/Ext-all.js" rel="nofollow">http://localhost/pos/static/Ext-all.js</a> Failed to load resource: the server responded with a status of 404 (Not Found)fetch @ Ext-all.js:22</em></li>
  <li><em>VM42:3 Uncaught TypeError: c is not a constructor</em></li>
  </ol>