PDA

View Full Version : how to add a button to Extjs datepicker



sundeep kapadia
27 Jul 2015, 9:21 PM
I am trying to add a button next to today button in extjs 3.3 datepicker , but its not coming in, please help me on this . thankyou


var simple = new Ext.FormPanel({
labelWidth: 75, // label settings here cascade unless overridden
url: 'save-form.php',
frame: true,
title: 'Simple Form',
bodyStyle: 'padding:5px 5px 0',
width: 350,
items: [
new Ext.DatePicker ({
scope:this,
hideParent:true,
handler: function(dp, date){
this.doSuspend(dp, date);
},
listeners: {
'afterrender' : function () {

new Ext.Button({
renderTo: this.picker.el.child('td.x-date-bottom', true),
text: "Reset",
cls: 'clear-dp',
//handler: function() {},
scope: this
});
},delay: 100
}
}),
new Ext.form.TimeField({
minValue: '9:00 AM',
maxValue: '6:00 PM',
increment: 30,
value : '3.00 PM'
})],

buttons: [{
text: 'Save'
}, {
text: 'Cancel'
}],
renderTo: Ext.getBody()
});


https://fiddle.sencha.com/#fiddle/qmv

tristan.lee
29 Jul 2015, 11:10 AM
You can add a button to the picker once the datefield's menu has been created:

rau

sundeep kapadia
29 Jul 2015, 11:31 PM
it worked !!!!!
super thanks a lot....