-
19 Dec 2012 10:32 PM #1
Unanswered: How to put Close button in date picker (calender)
Unanswered: How to put Close button in date picker (calender)
we can add a close button upper side of the calender. so that we can allow a 'calendar close' option. Anybody got an idea how to get it to work ? Pls give the code excerpts if you could think in line with this.
Please find the attached screen shot. Please help in this issue.
Regards,
PBasam.
-
22 Dec 2012 7:27 AM #2Sencha - Senior Forum Manager
- Join Date
- Mar 2007
- Location
- St. Louis, MO
- Posts
- 33,655
- Vote Rating
- 435
- Answers
- 3107
You would have to add a child to either the template or render elements after render.
Mitchell Simoens @SenchaMitch
Sencha Inc, Senior Forum Manager
________________
http://www.JSONPLint.com - Source to lint your JSONP!
Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
https://github.com/mitchellsimoens
Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/
Need more help with your app? Hire Sencha Services services@sencha.com
Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is almost in print!
When posting code, please use BBCode's CODE tags.
-
23 Dec 2012 6:22 AM #3
Hi,
This a simple solution that i use it, it just add a Close button beside Today button in the bottom of the date picker
Note: Ext.form.DateField uses Ext.picker.Date
It will like thisCode:Ext.override(Ext.picker.Date, { initComponent : function(){ this.on('afterrender', this.addCloseButton); this.callParent(); }, addCloseButton: function(){ var me = this, closeBtn = new Ext.Button({ text: "Close", ownerLayout: me.getComponentLayout(), handler: function(){ me.hide(); } }); closeBtn.render(this.todayBtn.container); } }); // Example on using it in Ext DateField Ext.onReady(function() { Ext.create('Ext.form.Panel', { renderTo: Ext.getBody(), width: 300, bodyPadding: 10, title: 'Date', items: [{ xtype: 'datefield', anchor: '100%', fieldLabel: 'Date', name: 'to_date', value: new Date() }] }); });
foo3.png
I hope that could help
Regards,
-
24 Dec 2012 1:53 AM #4
Thanks for your reploy, But this is not working on ExtJS3.3.1 version. this is working on ExtJS4.0 only


Reply With Quote