0

I have defined like

Ext.define('Abc.view.component.model.RegModel', {
    extend: 'Ext.data.field.String',
    alias: 'regionModel',
    name: 'REGION',
});

 Ext.define('Abc.view.report.trig.Model', {
        extend: 'Ext.data.Model',
        alias: 'TRIG',
        fields: [
            { xtype:'regionModel'}
        ]
    });

xtype i have defined and used does not work. How do i create such thing?

Hacker
  • 7,798
  • 19
  • 84
  • 154

2 Answers2

4

Use:

alias: 'data.field.regionModel'

Instead of:

alias: 'regionModel'

And in the Model use type instead of xtype.

(xtype is used for widget aliases only)

CD..
  • 72,281
  • 25
  • 154
  • 163
2

Pointing you to the right place in sencha docs.

http://docs.sencha.com/extjs/6.2.0-classic/Ext.data.field.Field.html#ext-data-field-field_custom-types

Arthanari C
  • 122
  • 6