I've been trying to use this code in order to apply default values to my fields:
Choo.window.CreateEntry = function( config )
{
config = config || {};
Ext.applyIf( config, {
title: 'Adding Featured Entry',
url: Choo.config.connector,
baseParams: { action: 'entry-create' },
fileUpload: true,
defaults: { xtype: 'textfield', width: '410' },
fields: [{
fieldLabel: 'Entry Image',
name: 'image',
inputType: 'file'
},{
fieldLabel: 'What up',
name: 'text'
}]
});
Choo.window.CreateEntry.superclass.constructor.call( this, config );
};
Ext.extend( Choo.window.CreateEntry, MODx.Window );
Ext.reg( 'choo-window-entry-create', Choo.window.CreateEntry );However, from testing it seems that the defaults parameter only applies to items and not fields, so the xtype and width do not get set. Is there a way I can get the defaults to apply also to fields, or do I need to use items?
Thanks