I have the customeventbox to display names from different tables on the event text space.
How do I bring it using this sample in these documents, scheduler.renderEvent and Templatesready. Please guide me.
docs.dhtmlx.com/scheduler/custom … splay.html
docs.dhtmlx.com/scheduler/custom … ntent.html
The “multiple tables” does matter only on data loading step - you need to provide the single json or xml data feed which combines data from all necessary tables ( in case of connector - you can use render_sql to select data from few tables )
After that you can use the event text templating to show necessary data in the event’s box.
ev is event table? how to do get my table name here?
[code]scheduler.renderEvent = function(container, ev) {
//here ev is event table? how to do get my table name here?
var container_width = container.style.width; // e.g. “105px”
// move section
var html = "<div class='dhx_event_move my_event_move' style='width: " +
container_width + "'></div>";
// container for event contents
html+= "<div class='my_event_body'>";
html += "<span class='event_date'>";
//two options here:show only start date for short events or start+end for long
if ((ev.end_date - ev.start_date)/60000>40){//if event is longer than 40 minutes
html += scheduler.templates.event_header(ev.start_date, ev.end_date, ev);
html += "</span><br/>";
} else {
html += scheduler.templates.event_date(ev.start_date) + "</span>";
}
// displaying event text
html += "<span>" + scheduler.templates.event_text(ev.start_date,ev.end_date,ev)+
"</span>" + "</div>";
// resize section
html += "<div class='dhx_event_resize my_event_resize' style='width: " +
container_width + "'></div>";
container.innerHTML = html;
return true; //required, true - display a custom form, false - the default form
};[/code]
“ev” is name of variable in template function, and need not to be changed.
All properties of event ( from all involved tables ) are accessible as
ev.property_name