onDateSelected doesn't work

I can’t get the “onDateSelected” event to fire on a calendar using DHTMLX Touch.

Here’s a test page :-

cmsdreams.co.uk/calendar.html

And the source for it is :-

<!DOCTYPE html>
<html>
<head>
<title>Calendar Test</title>
<link rel="stylesheet" type="text/css" href="codebase/touchui.css" />
<script type="text/javascript" src="codebase/touchui.js"></script>
</head>
<body>
<script type="text/javascript">
  dhx.ready(function(){
    dhx.ui({
      view:'calendar',
      id:'calendar'
    })
    $$('calendar').attachEvent('onDateSelected',function(date){
      alert(date);
    })
  })
</script>
</body>
</html>

In my application I want a user to click / tap a date in the calendar and use the date selected to filter a list. It doesn’t work so I stripped it down to see whether the event itself was firing and it doesn’t appear that it is.

What am I doing wrong?

Correct name of event is onDateSelect

$$('calendar').attachEvent('onDateSelect',function(date){ alert(date); })

If you have found incorrect name somewhere in docs - please point us to the misguiding page

Thanks, that works. The docs are wrong in that case :-

docs.dhtmlx.com/touch/doku.php?i … e_calendar
docs.dhtmlx.com/touch/doku.php?i … teselected

There’s also a reference in the forums (yes, I searched before posting)

viewtopic.php?f=22&t=16637&p=51472&hilit=onDateSelected#p51472

Thanks for the quick reply :smiley: