Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by hjshin on Sep 22, 2009 19:21
open dhtmlx forum
dhtmlxcalendar.js - dhtmlxEvent : wCal.con has no properties script error

hello~

* FireFox ( also IE7 has problem )

dhtmlxcalendar.js V2.5

calendar is in a grid.

script error occure after grid addRow

====================================

dhtmlxEvent(document.body,"click",function(ev){
     for (cal in window.dhtmlxCalendarObjects){
         var wCal = window.dhtmlxCalendarObjects[cal];
        
         if (wCal.con[0].nodeName == 'INPUT') ---> error
             wCal.hide ()
}});

---> script error

wCal.con has no properties
(no name)(click clientX=0, clientY=0)dhtmlxcalendar.js (line 119)
[Break on this error] if (wCal.con[0].nodeName == 'INPUT')


thanks~
Answer posted by Alex (support) on Sep 23, 2009 02:31

Hello,

Locally the issue isn't recreated. Please take a look at the sample:  dhtmlxGrid/samples/01_cell_types/01_calendar_grid.html ( http://www.dhtmlx.com/docs/products/dhtmlxGrid/samples/01_cell_types/01_calendar_grid.html )

If the problem still occurs, please provide a complete demo

Answer posted by ABernaus on Sep 29, 2009 08:38
I have the same problem without using dhtmlxGrid. I will try to recreate it in a simple form.
Answer posted by Abernaus on Oct 05, 2009 07:34
I'm sorry but I can't make an example that recreates the problem. But I' ve found that the problem in my case occurs when the calendar is attached to an <input>. If the calendars open on a <div> it works ok.
Answer posted by ABernaus on Oct 05, 2009 08:35
I'm going to correct my previous answer. The problems in my case is related with the use of prototype.js. Someone could confirm this point? Thanks
Answer posted by Matteo on Oct 08, 2009 06:43
Hi, I can confirm that point. I have the same problem with prototype.js . Without it works fine.
Answer posted by Stephan on Oct 23, 2009 15:18
We have the calendar object  attached to a div which is inside a layout container.
Clicking outside of the area of the calendar (on the toolbar for instance) throws the following error: wCal is undefined (dhtmlxcalendar.js Line 50) .
Answer posted by Stephan on Oct 23, 2009 15:20
Correction: error is wCal.con is undefined - not just wCal.

Answer posted by Martin on Oct 28, 2009 18:16

Have the exact same issue - Prototype.js and dhtmlxclaendar.js not playing together nicely. Throws up error - 'con.0' is null or not an object - when running the following - if (wCal.con[0].nodeName == 'INPUT') wCal.hide ()

Any progress on this issue?

 

Answer posted by Alex (support) on Oct 29, 2009 03:09

Hello

the attached version of calendar will solve the issue with prototype. Try to use it instead of the original one

Attachments (1)
Answer posted by Martin on Oct 29, 2009 03:56

Thanks Alex. Your posted code solves the issue... but creates a new one.

I have the calendar attached to an input box. Now when you open the calendar "NaN undefined NaN" appears in the input box. Click on a date in the calendar and the correct date appears in the input box. Click anywhere else on the screen and "NaN undefined NaN" remains in the input box.

Any ideas?

Answer posted by Alex (support) on Oct 29, 2009 09:13

Hello, 

locally the issue isn't reproduced. Please, provide some sample that allows to recreate it.