Attach TimeLine to Layout

Hi,
is it possible to attach a timeline scheduler to a layout?

scheduler.config.xml_date="%Y-%m-%d %H:%i"; dhxLayout2.cells("a").attachScheduler(null,"week"); scheduler.load("Connector");

With this client code i have attached a normal scheduler but i need to attach a timeline view and i wasn’t able to find an example on your documentation or in this forum.

Can you help me?
Thank you.

Jacopo.

Hello,

Please check following page:
docs.dhtmlx.com/doku.php?id=dhtm … pecificity

Kind regards,
Ilya

Thank you :slight_smile: It works :slight_smile:
Now i have another issue: after init and load this is what i see (load_1.jpg) and only when i click on a tabs or i change date i have the correct rendering (load_2.jpg).

this is my code:

[code]function init ()
{
var sections=<%=fod.get(“Sections”)%>;

  		scheduler.locale.labels.unit_tab = "<%=bundle.getString("lblUtentiGestione")%>";
  		scheduler.locale.labels.section_custom="<%=bundle.getString("lblUtentiGestione")%>";
  		scheduler.config.details_on_create=true;
  		scheduler.config.details_on_dblclick=true;
  		scheduler.config.xml_date="%Y-%m-%d %H:%i";
  		scheduler.config.lightbox.sections=[<%=fod.get("LightBoxSections")%>];
	
  		scheduler.createUnitsView({
  			name:"unit",
  			property:"section_id",
  			list:sections,
  			size:5,
  			step:5
  		});
  		//scheduler.config.multi_day = true;
  		scheduler.init('scheduler_here',new Date(),"unit");
  		scheduler.parse("<%=fod.get("Scheduler")%>");
  		var dp = new dataProcessor("PresenzeTurni");
  		dp.init(scheduler);

}[/code]
Can you help me?
Thank You.

Jacopo




How the code in your first message is connected to the second one?
Or you have two pages?

Best regards,
Ilya

Yes this is another page :slight_smile:

Hello,

Before trying anything fancy, maybe try to simple refresh current view:

scheduler.init('scheduler_here',new Date(),"unit"); scheduler.parse("<%=fod.get("Scheduler")%>"); var dp = new dataProcessor("PresenzeTurni"); dp.init(scheduler); scheduler.setCurrentView();
Best regards,
Ilya

Thank you :slight_smile:
Now it works :slight_smile:

one more question: is it possible to get current view id or name?

Be sure to check getState function.

Best regards,
Ilya

thank you :slight_smile:

i have another question :slight_smile: :

[code]scheduler.attachEvent(“onBeforeViewChange”, function (old_mode, old_date, mode , date){
if(old_mode != mode)
{
var evs = scheduler.getEvents();// will return all events
for (var i=0; i<evs.length; i++)
{
if(evs[i].readonly == “true”)
evs[i].readonly = “false”;
else
evs[i].readonly = “true”;
}

  		}
  		return true;
 	});[/code]

[code]
var visualizzazione = “unit”;
scheduler.attachEvent(“onViewChange”, function (mode , date){
if(visualizzazione != mode)
{
visualizzazione = mode;
var evs = scheduler.getEvents();// will return all events
for (var i=0; i<evs.length; i++)
{
if(evs[i].readonly == “true”)
evs[i].readonly = “false”;
else
evs[i].readonly = “true”;
}

  		}
  		return true;
   });[/code]

scheduler.getEvents() returns an empty collection…why?
Thank you.

Calling scheduler.getEvents() without parameters starting with 3.5 will return all loaded events. In 3.0 - will return nothing.

Maybe events are not yet loaded at the moment of the call.

Best regards,
Ilya

First call of view-change event occurs during scheduler.init, when scheduler doesn’t have any data yet.

thank you :slight_smile:

on your website i have downloaded 3.0 scheduler, is 3.5 avaible?

Only beta version for now
viewtopic.php?f=6&t=24594

3.5 will be officially released in next few weeks.

Ok thank you i ll wait official version :slight_smile:

[code] scheduler.attachEvent(“onBeforeLightbox”, function (event_id){
var ev = scheduler.getEvent(event_id);
if(ev != null && typeof ev != ‘undefined’ && ev.isIntervento ==“true” )
{
scheduler.config.lightbox.sections=[ {name:“Conferma Assegnazione”, height:48, map_to:“conferma_assegnazione”, type:“checkbox”,unchecked_value: “not_registered”},
{name:“description”, height:130, map_to:“text”, type:“textarea” , focus:true},
{name:“custom”, height:23, type:“select”, options:sections, map_to:“section_id”},
{name:“time”, height:72, type:“time”, map_to:“auto”}
];
}
else
{

			 scheduler.config.lightbox.sections=[	{name:"Tipo Evento", height: 48, options:presenza_assenza, map_to:"tipo_impegno", type:"radio", vertical: false },
		    	                            		{name:"description", height:130, map_to:"text", type:"textarea" , focus:true},
		    	                            		{name:"custom", height:23, type:"select", options:sections, map_to:"section_id"},
		    	                            		{name:"time", height:72, type:"time", map_to:"auto"}
		    	                            ];	 
			 }
		 return true;
    	
   });[/code]

Hi, i want to have 2 different lightbox based on ev type and i use this code, but i have a lot of issue: 1) when i open type 1 lightbox doesn’t change if i open type 2
2) when i create type 1 ev and then i open type 2 i have a javascript exception after pressing each button (save,cancel,delet) (stop_event is the root of exception)

Can you help me?
Thank you.

Hello,

Please post questions in separate threads - this way they would be helpful for future visitors which may have the same question.

Best regards,
Ilya