This is a migrated thread and some comments may be shown as answers.

RadDateTimePicker Error: 'get_calendar()' is null or not an object

1 Answer 66 Views
Calendar
This is a migrated thread and some comments may be shown as answers.
Martin
Top achievements
Rank 1
Martin asked on 24 Oct 2009, 08:25 AM
I ran into problem that RadDateTimePicker client object method "hidePopup" or "hideTimePopup" threw an error message: "'get_calendar()' is null or not an object".

Here is my code piece:
function HideAllCalendars() 
    iftypeof(jQuery) != 'undefined' ) 
    { 
        jQuery("div.RadCalendar").each(function() { 
        if (this
        { 
            // find first INPUT child node 
            var obj = null
            forvar i = 0; i < this.childNodes.length; i++ ) 
            { 
                var node = this.childNodes[ i ]; 
                if( node.tagName == 'INPUT' && node.id ) 
                { 
                    obj = node; 
                    break
                } 
            } 
            if( obj ) 
            { 
                var oo = $find(obj.id) 
                if(oo && oo.hidePopup && oo.hideTimePopup) 
                { 
                    oo.hidePopup(); 
                    oo.hideTimePopup(); 
                } 
            } 
        } 
        }); 
    } 

The oo.hidePopup or oo.hideTimePopup will throw the error message. Here is the exact error in the Telerik resource file:
for(var _32 in Telerik.Web.UI.RadDatePicker.PopupInstances){ 
if(Telerik.Web.UI.RadDatePicker.PopupInstances.hasOwnProperty(_32)){ 
var _33=Telerik.Web.UI.RadDatePicker.PopupInstances[_32].Opener; 
this._hideFastNavigationPopup(_33); 
Telerik.Web.UI.RadDatePicker.PopupInstances[_32].Hide(); 
},_hideFastNavigationPopup:function(_34){ 
if(_34){ 
var _35=_34.get_calendar()._getFastNavigation().Popup; //Error Happens here! 
if(_35&&_35.IsVisible()){ 
_35.Hide(true); 
},_setInputDate:function(_36){ 
this._dateInput.set_selectedDate(_36); 
},_getJavaScriptDate:function(_37){ 
var _38=new Date(); 
_38.setFullYear(_37[0],_37[1]-1,_37[2]); 
 

Why does the error happen? please help. Thanks.

1 Answer, 1 is accepted

Sort by
0
O'Man
Top achievements
Rank 1
answered on 28 Oct 2009, 03:09 PM
Hi Martin,

Can you please provide more details how to cause the error. On my machine iftypeof(jQuery) != 'undefined' )  is always 'undefined'. Maybe you can share a runnable code snippet for me to try.

Thanks
Oman


Tags
Calendar
Asked by
Martin
Top achievements
Rank 1
Answers by
O'Man
Top achievements
Rank 1
Share this question
or