The following solution may not be the best. However, it should work.
Extend Ext.form.field.Base . Then create an Ext.form.FieldSet in the afterrender handler and add it to the inputEl field. Then, of course, override the field valueToRaw , setRawValue , ...
Here is the code:
Ext.define('Ext.ux.form.field.MyCoolField', { extend:'Ext.form.field.Base', requires: ['Ext.util.Format', 'Ext.XTemplate'], fieldSubTpl: [ '<div id="{id}" class="{fieldCls}"></div>', { compiled: true, disableFormats: true } ], isFormField: true, submitValue: true, afterRender: function() { this.callParent(); this.fieldSet = Ext.create('Ext.form.FieldSet', { items: [{ // ... config of the first item // The following configs should be set to false. It important. // Otherwise form will assume this items as its fields isFormField: false, submitValue: false }); this.fieldSet.render(this.inputEl); }, // and here overriding valueToRaw and so on // ... });
source share