Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by MB on Jul 21, 2009 17:55
open dhtmlx forum
Adding dhtmlxcalendar to dhtmlxtoolbar

Hi,

How can I add the dhtmlxcalendar in dhtmlxtoolbar?

I have input text calendar which I want to add in the toolbar.

<BODY>
<div id="toolbar"></div>
<input type="text" id="input_new" class="css1"/>
<script>
var toolbar = new dhtmlXToolbarObject("toolbar");
mCal1 = new dhtmlxCalendarObject("input_new",false,{isYearEditable:true,isMonthEditable:true});
mCal1.draw();
</script>
</BODY>

Regards,
MB
Answer posted by Alex (support) on Jul 22, 2009 05:02

Hello,

toolbar doesn't support this functionality. But you can try to use the following approach:

window.onload = function (){
  var toolbar = new dhtmlXToolbarObject("toolbar");
  toolbar.addInput(itemId,0,"",100);
  var inputs = document.getElementsByTagName("INPUT");
  for (var i=0; i < inputs.length; i++)
    if(inputs[i].className =="dhtmlxToolbarInp"){

       cal = new dhtmlxCalendarObject(inputs[i],false,{isYearEditable:true,isMonthEditable:true})  ;....

   }
 }