PDA

View Full Version : About today button tooltip in datepiecker



Chap
23 Sep 2009, 9:53 PM
Hi,

I have a dateField. After I click the button, a datePicker would be shown. Here, I default time is setted by our system, not the client date time. The dataPick default time is fine, but today button's tooltip is still show the client date. How should I change the tooltip with the change of datePicker default time?

Below is the way I set the default time of datePicker, how should I control the today button tooltip??



Ext.form.myDateField = Ext.extend(Ext.form.DateField,{
onTriggerClick: function(){
Ext.form.myDateField.superclass.onTriggerClick.call(this);
this.defaultDate = myDateObj;
this.menu.picker.setValue(this.getValue()||this.defaultDate);
}
});

http://www.extjs.com/forum/attachment.php?attachmentid=16375&stc=1&d=1253772194

Chap
26 Sep 2009, 10:28 PM
:-?:-?:-?:-? No reply?

Animal
26 Sep 2009, 11:27 PM
The todayTip config in the docs is incorrect. It's not just a string, it's a template string in which the {0} token is substituted by the date. All other characters in the string are preserved. Set it to what you need.

Animal
26 Sep 2009, 11:58 PM
See the format config for the format of the data put there.

Chap
27 Sep 2009, 11:48 PM
Oh, thanks for Animal's help. It's Ok now. But another question is appeared. The todayTip is defined when the datePicker render operation. I have a cmp could set the datetime of our system. When I change a date for today, the todayTip would changed as new date setted, but today still show the initial date value. How should I change it?

I have the test only in datePicker. But how should I add the define into a dateField? That is to say, after I click dateField, how should the datePicker poped up attribute setted??

Animal
28 Sep 2009, 1:10 AM
Huh:-/

It's set correctly to whatever is today's date.