| Page 1 of 1 | [ 2 posts ] |
|
Good Afternoon,
I'm having some issues with a calendar module I am trying to create. I set up the event handlers to show and hide the calendar on specific events. However, when this.hide() is called nothing happens. I have confirmed that this.hide() is being called. Here is the Module Code Code: YUI.add('calendar',function(Y){ function Calendar(config){ Calendar.superclass.constructor.apply(this, arguments); } Calendar.NAME="calendar"; Calendar.ATTRS={ height:{value:"200px"}, width:{value:"200px"}, format:{value:"%x"}, inputField:{value:"null"} }; Y.extend(Calendar,Y.Calendar,{ initializer: function(config) { var dateInputField = Y.one(this.get("inputField")); dateInputField.on('focus',function(e){ this.render(); this.show(); },this); }, bindUI:function(){ this.on('selectionChange',function(ev){ var newDate = ev.newSelection[0]; var formattedDate = Y.DataType.Date.format(newDate,{format:this.get("format")}); dateInputField.set('value',formattedDate); this.hide(); },this); var dateInputField = Y.one(this.get("inputField")); dateInputField.on('clickoutside',function(e){ alert('in hide'); this.hide(); },this); } }); Y.Calendar = Calendar; }, '1.0.0', { requires : [ 'calendar','event','datatype-date','node' ] }); Any ideas would be great. Thanks |
Allen RabinovichYUI Developer
|
Are you actually using 'calendar' as the NAME of your extended module? The CSS class name used to hide the calendar is generated from the module name, and it is "yui3-{NAME property}-hidden". That class actually has an appropriate CSS attribute for hiding the DOM element. If your NAME is different, then you would have to make sure that yui3-yourname-hidden is defined in your CSS.
Another issue is overriding Calendar's bindUI (bindUI does not get chained on extend). bindUI contains essential logic and removing it will break your calendar. You'll want to do something like Y.after(this.bindUI, this, 'yourBindUI'); in the constructor, and then implement your own bindings in yourBindUI. Hope this helps. |
| Page 1 of 1 | [ 2 posts ] |
| You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum |
© 2006-2013 Yahoo! Inc. All rights reserved.
All code on this site is licensed under the BSD License unless stated otherwise.
About This Site · Security Contact Info
Powered by phpBB® Forum Software © phpBB Group