Loading y scale list from database in Timeline view

Hi,

In the timeline view, how do I load the y-scale items (key,label) from a mysql database using connectors (preferably) or any other built-in methods?

Thanks in advance!

Hello,

Please check the following sample
scheduler\samples\01_initialization_loading\09_connector_options.html

The same way you can load your list of options and use to create timeline view.

Kind regards,
Ilya

Hi,

I’ve gone through most of the samples but cannot find anything that would explain or show how to do what I am asking.

The main code in the sample you mentioned is…


<script type="text/javascript" charset="utf-8">
	function init() {
		scheduler.config.multi_day = true;
		scheduler.config.prevent_cache = true;
		
		scheduler.config.xml_date="%Y-%m-%d %H:%i";
		scheduler.init('scheduler_here',new Date(2010,2,1),"month");

		scheduler.locale.labels.section_type = "Resource";
		scheduler.config.lightbox.sections = [	
			{name:"description", height:200, map_to:"text", type:"textarea" , focus:true},
			{name:"type", height:21, map_to:"type", type:"select", 
				options:scheduler.serverList("type")},	
			{name:"time", height:72, type:"time", map_to:"auto"}	
		];
		scheduler.load("./php/types.php");
	}
</script>

It does show how to add the sections to the lightbox but nothing about the y-axis in the timeline view.

Maybe I am a little slow but could you please let me know / give more hints as to how to do load section information to be displayed as y-axis information in timeline view?

Thanks!

Hello,

php/types.php

Check that file, there we add new OptionsConnector which selects list of types (and in your case it could be sections).

options:scheduler.serverList("type")

and here we are assigning options property “type” serverList which is now array of key, value objects (just what you need to create timeline view).

Kind regards,
Ilya

Thanks for the hints. It worked. Cheers!