Hi,
I think I misread your question at some point.
Firstly, if the question is about setting the default value for selects, it can be solved in following way -
Given that you have two combos
{name: "Cliente", height: 30, map_to: "cliente", type: "select", options: scheduler.serverList("cliente")},
{name: "Utente", height: 30, map_to: "utente", type: "select", options: scheduler.serverList("utente")},
and they are mapped to “cliente” and “utente” properties respectively. Options can be accessed via server list - so in order to set default option you can capture onEventCreated, get available options from serverList there and assign value of option you want as a default one to the event
[code]scheduler.attachEvent(“onEventCreated”, function(id,e){
var event = scheduler.getEvent(id);
// select first option by default
var cliente = scheduler.serverList(“cliente”);
event.clietne = cliente.length ? cliente[0].key : “”;
var utente = scheduler.serverList("utente");
event.utente = utente.length ? utente[0].key : "";
});[/code]
Next, if you want to have a label of selected option in event text, you need to define event_text or event_bar_text template, get value of selected option from event object, get all available options via server list, find option which id is assigned to event and use its label - e.g.
scheduler.templates.event_text = function(start, end, event){
var clients = scheduler.serverList("clients");
var client = clients.find(function(c){ return c.key == event.client_id});
if(client) return client.label;
return "";
};
You can check this discussion for reference - forum.dhtmlx.com/viewtopic.php? … 14&start=0 - there is a link to the demo in my first reply, where templates do what’ve described above