Sencha Inc. | HTML5 Apps

The Class System

Published Apr 26, 2011 | The Sencha Dev Team | Guide | Medium
Last Updated Jul 11, 2011

This Guide is most relevant to Ext JS, 4.x.

Guide guides/class_system/README.js is not currently available
Share this post:
Leave a reply

Written by The Sencha Dev Team

2 Comments

Miguel Laynes

3 years ago

and How Is it when we’re working with Ext.define into ExtJS4 classes (like ext.data.model)...
..How to access the properties of my class (for example to fields array ) ?
check out the next code :

Ext.define(‘employeeMd’, {
      extend: ‘Ext.data.Model’,
  fields: [{
  name: ‘employeeName’,
  type: ‘string’
      },{
  name: ‘mgrName’,
  type: ‘string’
  },{
  name: ‘income’,
  type: ‘int’
  }]
});

in this code… employeeMd throws ....
    function() {
              return this.constructor.apply(this,arguments);
              }
...and employeeMd.fields throws ...“undefined”

how to create the object data.model?
Regards
@Mlaynes

Miguel Laynes

3 years ago

solved the case using the following code:

  Ext.define(‘employeeMd’, {
      extend: ‘Ext.data.Model’,
      fields: [{
            name: ‘employeeName’,
            type: ‘string’
            },{
            name: ‘mgrName’,
            type: ‘string’
            },{
            name: ‘income’,
            type: ‘int’
            }],
      constructor: function() {
            //alert(“Going to call parent’s overriden constructor…”);
            this.callParent(arguments);
            return this;
        },
        getFields: function() {
            return this.fields;
        }
    });
 
    var myModel = new employeeMd();
    var myFields = myModel.getFields();

    alert(‘employeeMd : ’ + employeeMd );
    alert(‘employeeMd.constructor : ’ + employeeMd.constructor );
    alert(‘myModel : ’ + myModel );
    alert(‘myFields : ’ + myFields );

..really interesting The New Way of ExtJs4 !

Leave a comment:

Commenting is not available in this channel entry.