PDA

View Full Version : replace Ext.menu.DateItem to ?



samotnik
28 Apr 2010, 12:19 AM
Hello.
In version 2.2 I used Ext.menu.DateItem for create calendar. But now, in version 3.2.1 that's not working.
Question: What should I use now ? Which class ?

Animal
28 Apr 2010, 12:37 AM
Ext.form.DateField

samotnik
28 Apr 2010, 12:51 AM
ok, thanks.
but, could you please help me to resolve a problem.
In the 2.2 version I wrote next :


var di = new Ext.menu.DateItem(config);
this.add(di);
this.picker = di.picker;
this.relayEvents(di, ["select"]);

this.on('beforeshow', function(){
if(this.picker){
this.picker.hideMonthPicker(true);
}
}, this);

And, how should I use now Ext.form.DateField ?

tobiu
28 Apr 2010, 1:37 AM
take a look at the api ;)
http://www.extjs.com/deploy/ext-3.2.1/docs/?class=Ext.form.DateField

you should not use the private property this.picker (which now is this.menu.picker), but you simply don't need it, since the form field will hide the calendar automatically.


kind regards,
tobiu

samotnik
28 Apr 2010, 1:46 AM
thanks ! Actually, I looked in the API, but I didn't understand, what exactly should I change ?
Could you please help in advice ?

Animal
28 Apr 2010, 2:42 AM
Add a DateField to the menu of course. What else?

samotnik
28 Apr 2010, 3:03 AM
ok, thanks a lot !