Multiselect field options

I am new to scheduler and need some additional info how to define/load options for multiselect section. In documentation definition of options is defined like:
options: scheduler.serverList(“fruit_id”),
script_url: ‘php/events_multiselect_options.php’,

  1. What is the format of options found in scheduler.serverList(“fruit_id”)?
  2. Can I use any url in script_url? What should it return?
  3. How the two parameters work together?

Please quide me towards the light, Martti

It uses the same format as normal selects

[ {key:1, label:"Section A"}, {key:2, label:"Section B"}, {key:3, label:"Section C"}, {key:4, label:"Section D"} ]

Can I use any url in script_url?
Technically any, it return xml with list of selected options for the item in question.

options - defines list of possible options
script_url - used to get list of cheched for the event in question

check
samples\03_extensions\21_multiselect_options.html
samples\03_extensions\22_multiselect_initial_loading.html

So I can define the options like this:
var myoptions[
{key:1, label:“Section A”},
{key:2, label:“Section B”},
{key:3, label:“Section C”},
{key:4, label:“Section D”}
]
…, options: myoptions …;
And I must use some valid url for script url (empty url gives an error as I noticed when testing) to load selections for current event. For new event this can be null or empty? What is the format for this list of cheched selections?
Martti

Yes, this seems to be working ok with new events:
{ name:“control”, height:100, options: controls, type:“multiselect”, map_to:“control”, script_url:"" }

The question remains in what format information for existing events is returned by url call .
Martti

Hello,

Following xml is returned by 22_multiselect_initial_loading.html sample:

<?xml version='1.0' encoding='utf-8' ?><data><event id='108' ><start_date><![CDATA[2009-11-05 10:15:00]]></start_date><end_date><![CDATA[2009-11-05 13:35:00]]></end_date><text><![CDATA[]]></text><details><![CDATA[Tokyo]]></details><user_id><![CDATA[3,2]]></user_id><fruit_id><![CDATA[2,3]]></fruit_id></event><event id='107' ><start_date><![CDATA[2009-11-03 14:05:00]]></start_date><end_date><![CDATA[2009-11-03 16:15:00]]></end_date><text><![CDATA[]]></text><details><![CDATA[Belgium]]></details><user_id><![CDATA[3,1]]></user_id><fruit_id><![CDATA[5,4,1]]></fruit_id></event><event id='109' ><start_date><![CDATA[2009-11-04 08:25:00]]></start_date><end_date><![CDATA[2009-11-04 12:10:00]]></end_date><text><![CDATA[New event]]></text><details><![CDATA[]]></details><user_id><![CDATA[2]]></user_id><fruit_id><![CDATA[2,3]]></fruit_id></event><coll_options for='user_id'><item value='1' label='George'></item><item value='2' label='Nataly'></item><item value='3' label='Diana'></item><item value='5' label='Adam'></item></coll_options><coll_options for='fruit_id'><item value='1' label='Orange'></item><item value='2' label='Banana'></item><item value='3' label='Peach'></item><item value='4' label='Kiwi'></item><item value='5' label='Plum'></item><item value='6' label='Grapefruit'></item><item value='7' label='Lime'></item><item value='8' label='Lemon'></item><item value='9' label='Mandarin'></item><item value='10' label='Pineapple'></item></coll_options></data>

So it’s a list of ids joined by ‘,’ character.

Best regards,
Ilya