Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by Martin Allchin on Aug 03, 2009 02:48
open dhtmlx forum
calendar initilisation

Hello,

I am trying to initialise a dhtmlxCalendar like so:

ajaxVCallsCalendar_START = new dhtmlxCalendarObject('START_DATE',true);

It fails because the target div 'START_DATE' is located on a page attached to a cell of a dhtmlxLayout. This fails as it is unable to locate the div when initialising the calendar. How am I able to reference the div please?

Full code here:

ajaxVCallsWindow = dhxWins.createWindow('ajaxVCallsWindow', 0, 0, 560, 340);
ajaxVCallsWindow.centerOnScreen();
ajaxVCallsWindow.setText('VCalls');
ajaxVCallsWindow.button('park').disable();
ajaxVCallsWindow.button('park').hide();
ajaxVCallsLayout = ajaxVCallsWindow.attachLayout('2E', 'dhx_blue');
ajaxVCallsLayout.cells('a').hideHeader();
ajaxVCallsLayout.cells('a').setHeight(70);
ajaxVCallsLayout.cells('a').fixSize(true, true);
var url = 'ajaxVCallsWindow.php';
url = url + '?s=a';
ajaxVCallsLayout.cells('a').attachURL(url);
ajaxVCallsLayout.cells('a')._frame.onload = function(){
ajaxVCallsCalendar_START = new dhtmlxCalendarObject('START_DATE',true);
ajaxVCallsCalendar_START.draw();
}
ajaxVCallsLayout.cells('b').hideHeader();
ajaxVCallsGrid = ajaxVCallsLayout.cells('b').attachGrid();
ajaxVCallsGrid.setImagePath('/3rdparty/dhtmlx/imgs/');
ajaxVCallsGrid.setHeader('DDI,Date,Calls,Duration,CLI,Call Times');
ajaxVCallsGrid.setInitWidths('70,80,50,80,100,*');
ajaxVCallsGrid.setColAlign('left,left,left,left,left,left');
ajaxVCallsGrid.setColTypes('ro,ro,ro,ro,ro,ro');
ajaxVCallsGrid.setColSorting('int,str,str,str,str,str');
ajaxVCallsGrid.setColumnsVisibility('false,false,false,false,false,false');
ajaxVCallsGrid.enableMultiselect(false);
ajaxVCallsGrid.setSkin('light');
ajaxVCallsGrid.preventIECaching(true);
ajaxVCallsGrid.init();
var url = 'ajaxVCallsGrid.php';
url = url + '?DDIs='+ajaxDDIsGrid.getSelectedId();
ajaxVCallsGrid.loadXML(url);
Answer posted by Alex (support) on Aug 03, 2009 03:43

Hello, 

possibly the following approach will be more correct to initialize calendar:

ajaxVCallsCalendar_START = new dhtmlxCalendarObject(ajaxVCallsLayout.cells('a')._frame.contentWindow.document.getElementById('START_DATE'),true); 

But it will be easier to call initialization code from the ajaxVCallsWindow.php page.

Answer posted by Martin Allchin on Nov 06, 2009 04:19
Thanks.

I'm still getting the error 'this.con is null'.

Have tried initilising from page but still having trouble.
Answer posted by Martin Allchin on Nov 06, 2009 05:08
Fixed it, thanks. I had a typo :)