my item :
xtype: 'monthfield',
reference: 'debutmonth',
emptyText: 'date',
format: 'F, Y'
when i use
disabledYears: ['../2021']
the year is always selectable
my item :
xtype: 'monthfield',
reference: 'debutmonth',
emptyText: 'date',
format: 'F, Y'
when i use
disabledYears: ['../2021']
the year is always selectable
You can use the Ext.picker.Date to set the years disabled. The years can be selectable in the picker dropdown but the dates will be disabled for the entire year(s).
Ext.application({
name : 'Fiddle',
launch : function() {
Ext.create('Ext.form.Panel', {
renderTo: Ext.getBody(),
width: 300,
bodyPadding: 10,
title: 'Dates',
items: [{
xtype: 'datefield',
anchor: '100%',
fieldLabel: 'From',
name: 'from_date',
listeners:{
afterrender: function(datefield){
var datePicker = datefield.getPicker();
datePicker.setDisabledDates(['../../2016','../../2017','../../2018','../../2019']);
}
}
}]
});
}
});