PDA

View Full Version : creating adv-vtypes.html example with ext.designer?



franklt69
29 Jul 2010, 8:56 AM
Hi I have a doubt in this example are using an attribute that no appear in the Component Config grid:



{
fieldLabel: 'Start Date',
name: 'startdt',
id: 'startdt',
vtype: 'daterange',
endDateField: 'enddt' // id of the end date field
}


how can add it using the designer?

regards
Frank

wemerson.januario
29 Jul 2010, 3:52 PM
I think you have promote to class your datefield and set endDateField .in initComponet call. the vtype config you can set on designer

jarrednicholls
29 Jul 2010, 8:38 PM
Wemerson is correct, that would be the approach to take: Right-click->Promote to Class on the Field, and then implement the endDateField property. The endDateField is not an Ext JS API configuration for the DateField component, it is specific to that example.

franklt69
30 Jul 2010, 5:36 AM
to get whole picture, because since i am a little bit confuse, I promote to class:


MyDateFieldUi = Ext.extend(Ext.form.DateField, {
initComponent: function() {
MyDateFieldUi.superclass.initComponent.call(this);
}
});

how can then implement the endDateField property ?

regards
Frank

jarrednicholls
30 Jul 2010, 5:50 AM
MyDateFieldUi = Ext.extend(Ext.form.DateField, {
initComponent: function() {
this.endDateField = 'enddt';

MyDateFieldUi.superclass.initComponent.call(this);
}
});

franklt69
30 Jul 2010, 7:00 AM
ok thanks

regards Frank

jarrednicholls
30 Jul 2010, 7:06 AM
You bet!