Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by Lagos John on Dec 13, 2008 05:50
open dhtmlx forum
Calendar error

I use the PRO and on a Toolbar I attach a calendar to an Input Item.


My code is as:

webBar.addInput("i1",4,"",70);
            
         // Attach Calendar
             mCal = new dhtmlxCalendarObject("i1",true);
         mCal.draw();

...and I get the Error:

this.con is null

onmousemove()()dhtmlxcalendar.js (line 50)
startDrag()(undefined)dhtmlxcalendar.js (line 82)
show()(true)dhtmlxcalendar.js (line 85)
loadUserLanguage()("en-us", undefined)dhtmlxcalendar.js (line 83)
dhtmlxCalendarObject("i1", true, undefined)dhtmlxcalendar.js (line 48)

[Break on this error] this.daysPan.className = "dxcaldays";th...ick = function () {if (self.isVisible())

Please help.
Thanks,
John
Answer posted by Support on Dec 15, 2008 02:36
The problem is incompatible ids:

webBar.addInput("i1",4,"",70); and mCal = new dhtmlxCalendarObject("i1",true);
They are different.

Make a little fix in the dhtmlxtoolbar.js file:

dhtmlXToolbarObject.prototype._buttonInputObject = function(that, id, data, pos) {
    ...
    this.obj.innerHTML = "<table cellspacing='0' cellpadding='0' class='itemDefault'>"+
                "<tr>"+
                    "<td valign='middle'"+(this.img!=""?"":" style='display: none;'")+">"+
                        "<input class='dhtmlxToolbarInp' id='"+id+"' type='text' style='width:"+this.obj.w+"px;'"+(data.getAttribute("value")!=null?" value='"+data.getAttribute("value")+"'":"")+">"+
                    "</td>"+
                "</tr>"+
            "</table>";

Answer posted by Support on Dec 15, 2008 03:42
... or you can use the following was (without editing dhtmlxtoolbar.js):

webBar.addInput("i1",4,"",70);
var inpObj = webBar.objPull[webBar.idPrefix+"i1"].obj.childNodes[0].childNodes[0].childNodes[0].childNodes[0].childNodes[0]; // <- input object
// Attach Calendar
mCal = new dhtmlxCalendarObject(inpObj,true);
mCal.draw();