Hi
My multiselect option is below. Selected items is coming from “testdata.json” . But when The lightbox opened, selections is does not appear.
How to show selections in the multi select option???
My lightbox
var options = [
{key: "sprechstunde", label: "Sprechstunde"},
{key: "eeg", label: "EEG"},
{key: "nlg", label: "NLG"},
{key: "uU", label: "u.U."},
{key: "gt", label: "GT"},
{key: "mmpi", label: "MMPI"},
{key: "rehacom", label: "RehaCom"},
{key: "duplex", label: "Duplex"},
{key: "pt", label: "PT"}];
scheduler.config.lightbox.sections = [
{
name: "fruitselect",
height: 100,
map_to: "department",
type: "multiselect",
options: options ,
script_url: 'testdata.json',
vertical: "false"
}
];
testdata.json
[
{"key": "sprechstunde", "label": "Sprechstunde"},
{"key": "eeg", "label": "EEG"},
]
Hi,
do you need these options to be selected initially, when new event is created?
If so, you may specify them in multiselect configurationscheduler.config.lightbox.sections = [
{
name: "fruitselect",
height: 100,
map_to: "department",
type: "multiselect",
options: options ,
script_url: 'testdata.json',
vertical: "false",
default_value: "sprechstunde,eeg"//comma separated keys
}
];
script_url can be used to load whole list of options from the server, in case you don’t specify ‘options’. It can’t be used to select options in control
Hi,
I added “default_value” property as below but checked values did not come
Where am I doing wrong?
Thanks
var options = [
{key: "1", label: "Sprechstunde"},
{key: "2", label: "EEG"},
{key: "3", label: "NLG"},
{key: "4", label: "u.U."},
{key: "5", label: "GT"},
{key: "6", label: "MMPI"},
{key: "7", label: "RehaCom"},
{key: "8", label: "Duplex"},
{key: "9", label: "PT" }];
scheduler.config.lightbox.sections = [
{
name: "description",
height: 130,
map_to: "text",
type: "textarea",
focus: true
},
{
[b]name: "departmentselect",
height: 100,
map_to: "department",
type: "multiselect",
options: options,
default_value: "1,2",
vertical: "false"[/b]
},
{
name: "recurring",
height: 115,
type: "recurring",
map_to: "rec_type",
button: "recurring"
},
{
name: "time",
height: 72,
type: "time",
map_to: "auto"
}
];
Hi,
looks like multiselect does not handles ‘default_value’ config, sorry for the inconvenience.
Try assigning initial values directly to the event, right after it’s created: scheduler.attachEvent("onEventCreated", function(id){
scheduler.getEvent(id).department = "1,2";
});
Thanks for reply Aliaksandr
I added eventCreated Handler and the problem solved.
Thanks