PDA

View Full Version : Date field change date picker style



navvn
1 Dec 2011, 3:43 AM
Is it possible to change date picker style in date field? All config options are bonded with date filed not ith a picker.

tobiu
1 Dec 2011, 5:48 AM
take a look at the theming SASS variables or just inspect the dom of the datepicker, see which CSS classes it uses and change them to your needs.

navvn
1 Dec 2011, 5:54 AM
well i dont want to change it globaly, just for one date field. When i add id to it and than try to style it i can't because id belongs to input field not to seperatly created div with picker.

tobiu
1 Dec 2011, 6:00 AM
well, then take a look at:
http://docs.sencha.com/ext-js/4-0/source/Date4.html#Ext-form-field-Date



createPicker: function() {
var me = this,
format = Ext.String.format;

return Ext.create('Ext.picker.Date', {
pickerField: me,
ownerCt: me.ownerCt,
renderTo: document.body,
floating: true,
hidden: true,
focusOnShow: true,
minDate: me.minValue,
maxDate: me.maxValue,
disabledDatesRE: me.disabledDatesRE,
disabledDatesText: me.disabledDatesText,
disabledDays: me.disabledDays,
disabledDaysText: me.disabledDaysText,
format: me.format,
showToday: me.showToday,
startDay: me.startDay,
minText: format(me.minText, me.formatDate(me.minValue)),
maxText: format(me.maxText, me.formatDate(me.maxValue)),
listeners: {
scope: me,
select: me.onSelect
},
keyNavConfig: {
esc: function() {
me.collapse();
}
}
});
}


this is the method you need to override. you can add a custom class there as a varibale and pass it through for your instance of the field.