Hello,
i´am trying to customize the events content (event text) with the following function:
scheduler.attachEvent("onTemplatesReady", function(){
scheduler.templates.event_text=function(start,end,event){
return "<b>" + event.text + "</b><br><i>" + "Ort: " + event.event_location+ "<br>" + "Team: " + event.section_id + "<br>" + "Fahrzeug: "+ scheduler.serverList("cars") "</i>";
}
});
All works great besides the part with scheduler.serverList. I want to output the Label of the chosen car. (see attached Image)
The ServerList Part
scheduler.createUnitsView({
name:"cars",
property:"custom",
list:scheduler.serverList("cars"),
size:20,
step:1
});
The Lightbox Part
scheduler.config.lightbox.sections=[
...
{name: "cars", height: 25, map_to: "cars_id", type: "select", options: scheduler.serverList("cars")},
...
]
The SQL Part
$list2 = new OptionsConnector($res, $dbtype);
$list2->render_table("cars","cars_id","cars_id(value),name(label)");
$scheduler->set_options("cars", $list2);
$scheduler->render_table("events","event_id","start_date,end_date,event_name,details,event_location,section_id,cars_id,important");
This is the XML Output Part of the SQL Query
<coll_options for="cars">
<item value="1" label="CAR 1"/>
<item value="2" label="CAR 2"/>
<item value="3" label="CAR 3"/>
<item value="4" label="CAR 4"/>
<item value="5" label="CAR 5"/>
<item value="6" label="CAR 6"/>
<item value="7" label="CAR 7"/>
<item value="8" label="CAR 8"/>
<item value="9" label="CAR 9"/>
</coll_options>
Thank you for your help!