PDA

View Full Version : Ext.form: Additional Text



Friedel
27 Apr 2007, 12:32 AM
Hi!

First of all: Ext is really great work! I love it!! :)

I have a problem using Ext.form: I want to get additional information-fields
into my form like some date-fields, multirow-texts and so on. Is there any
way to achieve this?

Screenshot1: This is how it's solved now: disabled fields
Screenshot2: This is how I want it to look!


f.container({width: 240 });
f.fieldset( {legend: 'Sonstige Daten' } );
f.add(
new Ext.form.DateField({
id: "blubdiwup",
fieldLabel: 'Date 1',
name: 'birthdate'
}),
new Ext.form.DateField({
fieldLabel: 'Date 2',
name: 'first_order_date',
disabled: true
}),
new Ext.form.TextField({
fieldLabel: 'Textfield',
name: 'user_axgent',
disabled: true
})

);
f.end(); // close Fieldset
f.end(); // close Container


Best regards
Friedel

Friedel
27 Apr 2007, 12:39 AM
Okay, I found a solution for that!

http://extjs.com/forum/showthread.php?t=5243



new Ext.form.Field({
autoCreate: {tag: 'div', cn:{tag:'div'}},
fieldLabel: 'Label',
dataIndex : 'field', // if you using Form.load, this would work
value: true,
setValue: function(val) {
this.value = val;
if(this.rendered){
this.el.child('div').update(
val ? 'foo' : 'bar'
);
}
},
getRawValue : function() { return this.value; }
}),


:)