PDA

View Full Version : Issue with DateField (4.2.2)



ha15hans
2 Apr 2014, 7:57 AM
I am currently having an issue with the xtype=datefield.

Currently my code looks like this:

xtype: 'datefield',
id: 'publishfromdate',
width: 241,
height: 28,
editable: false,
value: Ext.Date.add(new Date(), Ext.Date.DAY, -1),
maxValue: new Date(),
minValue: Ext.Date.add(new Date(), Ext.Date.DAY, -30),
showToday: false,
anchor:'100%',

The issue is that the same date in every month gets highlighted. What I mean is if value is April 1, then March 1, February 1, etc are all highlighted as they have the CSS style x-datepicker-selected appended to them.

I am unsure on how to resolve this issue because the code seems to look correct and be working correctly? Does anyone have an idea is this something simple I am not seeing?

Any help that can be offered would be greatly appreciated! (Using ExtJS 4.2.2)

scottmartin
2 Apr 2014, 12:53 PM
Looks like you may have to override the setCellClass function to remove the cls.

Ext.form.field.Date :: fullUpdate :: setCellClass

ha15hans
3 Apr 2014, 9:22 AM
I am not sure what you mean by this as I do not see this information anywhere in Sencha Docs.

scottmartin
3 Apr 2014, 9:36 AM
This seems to be default behavior .. so you will need to take the existing code and override the behavior.

In this case, you would overrider the class / function and change the code to behave the way you want it to:

It is actually the picker, not the date field.



Ext.define('Ext.picker.override.Date', {
override : 'Ext.picker.Date',

fullUpdate: function(date){
// take the existing code and make the changes needed; looking specifically in setCellClass function
}

});