Lightbox Select populated from server

Hi,

I’m trying to create a select list with options retreived from the server as Json. I cannot figure out how to get the select list populated. If I manually type the data I receive from the server into the select then it works fine but if I use a varaible it does not work.

I have a local variable called locOptions with the array that need to be displayed in the select list.

My scheduler.config.lightbox.sections = [ section has the following entry:

{ name: "Locations", height: 21, type: "select", map_to: "Locations", options: locOptions }

The content of locOptions is:

[{key: "", label:"Select a location..."},{key: "8", label: "Hilton"},{key: "7", label: "Hilton 2"},{key: "6", label: "Hilton 3"}]

What I get is a big list of options that say ‘undefined’.

Looking at this page docs.dhtmlx.com/scheduler/select.html I cannot figure out how to populate the select in the lightbox from the server or find code that points me in the right direction that is .Net/MVC based. Te examples are php base and I can’t figure out where or how I do the equivelant.

Can anyone help point me in the right direction?

Thanks,
KDee.

Hello,
If you update options on the client side, you can use scheduler.serverList/scheduler.updateCollection methods
Please check this example
github.com/DHTMLX/scheduler-doc … d#examples

  • you initalize an empty select using scheduler.serverList(“someName”), then you somehow load options from the server and when it’s done - update select using scheduler.updateCollection.

If you initialize select from C# code you can set collection name using LightboxSelect.ServerList property. After that you’ll be able to update it using scheduler.updateCollection or load options with the data as shown here blog.scheduler-net.com/post/cust … r-net.aspx