problems event links

Hello

I have a little problem, I create a link to an event, and I want to put the date “start_date” link in the settings, but it does not work. for the “id” it works but not for start_date.
I get an error of type [object Object]

        scheduler.attachEvent("onClick", function (id, start_date){
        location.href="details.php?id="+id+"&start_date="+start_date;
        });

            scheduler.parse([
                { start_date: "2013-03-12 09:00", end_date: "2013-03-12 09:15", text:"RDV 10",  color:"#ccc", id:10,},
				{ start_date: "2013-03-12 09:15", end_date: "2013-03-12 09:30", text:"RDV 11",  color:"#ccc", id:11,},
				{ start_date: "2013-03-12 09:30", end_date: "2013-03-12 09:45", text:"RDV 12",  color:"#ccc", id:12,},
				{ start_date: "2013-03-12 09:45", end_date: "2013-03-12 10:00", text:"RDV 13",  color:"#aaa", id:13,},
				{ start_date: "2013-03-12 10:00", end_date: "2013-03-12 10:15", text:"RDV 14",  color:"#ccc", id:14,},
				{ start_date: "2013-03-12 10:15", end_date: "2013-03-12 10:30", text:"RDV 15",  color:"#ccc", id:15,},
            ], "json");

Thank you for your help

Hi,
onClick event does not pass event date to the handler
docs.dhtmlx.com/doku.php?id=dhtm … nt_onclick
You need to get it manuallyscheduler.attachEvent("onClick", function (id){ var dateToStr = scheduler.date.date_to_str("%Y-%m-%d %H:%i"); var start_date = scheduler.getEvent(id).start_date; location.href="details.php?id="+id+"&start_date="+dateToStr(start_date); });

Thank you for your help :slight_smile:

Hello
when I use the same method to create an event, it returns an error
"has no method ‘api_date’ "

scheduler.addEvent("onClick", function (id){
   var dateToStr = scheduler.date.date_to_str("%Y-%m-%d %H:%i");
   var start_date = scheduler.getEvent(id).start_date;
   location.href="create.php?id="+id+"&start_date="+dateToStr(start_date);
});

Thank you for your help

please check the api reference
docs.dhtmlx.com/doku.php?id=dhtm … r_addevent