PDA

View Full Version : EXTJs calendar , Deselecting the selected date



Soumyajm
2 Aug 2012, 1:17 AM
Hi i am using Extjs calendar in my project . My requirement is I have selected one date in datepicker and on click of some button outside the calendar the selected day should get deselect . How i can achive this ?

var datePickerForDay = Ext.create('Ext.panel.Panel',{
id:'datePickerBody',
collapsible:false,
border:false,
width: 194,
height:190,
frame:false,
bodyStyle:{padding:'10px 0 10px 0'},
items: [{
id: 'reportDay',
xtype:'gbiDatepicker',
}]
});

Please help me on this ASAP

scottmartin
8 Aug 2012, 9:53 AM
You could use the following:



var dp = Ext.create('Ext.picker.Date', {
minDate: new Date(),
renderTo: Ext.getBody()
});

Ext.create('Ext.Button', {
text: 'Click me',
renderTo: Ext.getBody(),
handler: function() {
dp.setValue(undefined);
}
});


Scott.