-
18 Dec 2012 12:54 AM #1
How to set the tooltip of datepicker cells of a datefield
How to set the tooltip of datepicker cells of a datefield
I have a form with a datefield. The datepicker of the datefield has a tooltip on every cell, which shows the current date in the following format: 'F d, Y'
I need a different format: 'j. F Y'
I spend a lot of time in searching after this... Every tooltip from datepicker has a describing property, configurable on the datefield, except of what I am looking for. What I found out is that the format is corresponding to the 'longDayFormat'-config property from datepicker. But I can not set this on datefield.
So how can I set the tooltip of the cells of the datepicker from a form's datefield? Please help and thank's in advance!
-
19 Dec 2012 2:10 PM #2Sencha - Senior Forum Manager
- Join Date
- Mar 2007
- Location
- St. Louis, MO
- Posts
- 33,641
- Vote Rating
- 434
You need to configure the longDayFormat config on the picker.
Mitchell Simoens @SenchaMitch
Sencha Inc, Senior Forum Manager
________________
http://www.JSONPLint.com - Source to lint your JSONP!
Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
https://github.com/mitchellsimoens
Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/
Need more help with your app? Hire Sencha Services services@sencha.com
Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is almost in print!
When posting code, please use BBCode's CODE tags.
-
20 Dec 2012 1:35 AM #3
I don't configure the date picker. I just configure a datefield on a form panel. But, because I don't see a different way, I tried it.
I did the following: On the initComponent-method of my form panel I first create the datefield, then I use the datefields' getPicker-method and configure the longDayFormat to 'j. F Y'. While debugging I can see the right format in the longDayFormat config, BUT on the view it's still in the false format ('F d, Y'). I don't know why? Could you please help. Perhaps it's a bug? We use ExtJs 4.1.1.Code:initComponent: function () { var me = this; var myDatefield = Ext.create('widget.datefield', { fieldLabel: 'Gültig ab', labelWidth: 80, startDay: 1, // Starttag der Woche ist Montag minValue: new Date() }); var myDatepicker = myDatefield.getPicker(); //to get the datepicker of my form panels' datefield Ext.apply(myDatepicker, { longDayFormat: 'j. F Y' // dt. format als tooltip }); Ext.applyIf(me, { items: [ // ... some form panel items myDatefield, // ... some form panel items
As remark:
We use the german localization-file (ext-lang-de.js). So on datefield/-picker the format, disabledDaysText, disabledDatesText, maxText, minText, dayNames, today-btn. text etc. has changed to the desired format, but the longDayFormat (should be 'j. F Y') and the startDay (should be Monday - 1) has not. Perhaps a bug?
Additionaly in my opinion the config-name 'longDayFormat' is not really describing, that this is config for a tooltip of the cells of the datepicker. Please add this to the docs. And it would be nice to configure the datepicker belonging to a datefield directly on the datefield.


Reply With Quote