I gotta good progress on my project to find out free time slots via website.
Will share the code to the community, if anybody is interrested…
But before i am frustrating in jumping to a speciffic Date, or a speciffic time within a date in scheduler.
The task is to klick on a textlink (in a seperatet dialog over the scheduler) and than scheduler should setCurrentView to the clicked date (and time).
I have a method to jump to a specific event, this is for searching an existing event, click on it in the reuslt and scheduler set the view to the specified EXISTING event…
In this case i need to jump to the timeslot, that is free… So i have no event_id to give to the function…
I can only share the information “24.02.2011 08:15” for example…
Perhaps you can give me a clue, how to change my existing function?
function goto_event(id) {
var goto_temp = scheduler.getEventStartDate(id);
var temp_pos = goto_temp.toString().indexOf(":");
var temp = goto_temp.toString().charAt(temp_pos-2)+""+goto_temp.toString().charAt(temp_pos-1);
// alert(temp);
// Thu Oct 07 2010 09:00:00 GMT+0200
scheduler.setCurrentView(goto_temp,"day");
scheduler.select(id);
scheduler._els["dhx_cal_data"][0].scrollTop = (temp - scheduler.config.first_hour) * scheduler.config.hour_size_px;
}
By using scheduler.date.str_to_date you can convert your date string to date object and use it inside the setCurrentView. Scrolling to the necessary hour can be done through simple math
[code]var target = “24.02.2011 08:15”;
var fdate = scheduler.date.str_to_date("%d.%m.%Y %H:%i");
var dateobj = fdate(target);
scheduler.setCurrentView(dateobj,“day”);
var pos = dateobj.getHours()1+dateobj.getMinutes()/60;
scheduler._els[“dhx_cal_data”][0].scrollTop = (pos-scheduler.config.first_hour) * scheduler.config.hour_size_px;
[/code]
Hi,
I open this discussions again because i use the 2Fast4UeXtrem function. I want a link that open map view and select the event by the id.
I use the function and script switch correctly to map view, but dont’ select my event.
where is the problem? the id is ok (testing by alert)…
[code]
function goto_event(id) {
var goto_temp = scheduler.getEventStartDate(id);
var temp_pos = goto_temp.toString().indexOf(":");
var temp = goto_temp.toString().charAt(temp_pos-2)+""+goto_temp.toString().charAt(temp_pos-1);
scheduler.setCurrentView(goto_temp,“map”);
scheduler.select(id);
}[/code]
the link (write by js)
document.getElementById("reportMAP").innerHTML = '<a href="#" onclick="goto_event('+event_id+');" title="mappa">Mappa</a>';
thanks!
Fra
Get a guaranteed answer from DHTMLX technical support team
under the most suitable support plan