Custom views for 3.5 don't work as documented

It appears that the documentation on docs.dhtmlx.com/doku.php?id=dhtm … e_advanced needs to be updated.

It refers to

scheduler.config.views.push({...

It should state

scheduler.config.tab_views.push({...

This is key, as it deviates from the previous version (v3.0). Also, this should be provided as part of the Change Log so that developers can make the appropriate change when they update their libraries.

All my best,
Rob

tab_views contains main views: List, Day and Month. views - all other views including custom views that can be added in Scheduler. Therefore, docs are correct.

Yes, you can add other views, but the problem is that when you do,

$$("scheduler").$$("month").show();
doesn’t work anymore.

In order for it to work, you need to ‘push’ to tab_views, not views as shown in the documentation.

Unless I’m missing something, which is entirely possible.

Hello,

Locally $$(“scheduler”).$$(“month”).show(); works. We need the sample if the issue is still actual.

Alexandra,

Sorry for the delay. Here’s an example of non-working code (although properly written in accordance with the documentation):

	<script src="codebase/dhxscheduler_mobile-3.5.js" type="text/javascript"></script>
	<script src="codebase/dhtmlxcommon-3.5.js" type="text/javascript"></script> 
	<link rel="STYLESHEET" type="text/css" href="codebase/dhxscheduler_mobile-3.5.css">
	<script type='text/javascript'>
		function showSetup(){
			$$("scheduler").$$("setupForm").show();
		};
		function showCalendar(){
			$$('scheduler').$$('month').show();  
		};
		scheduler.config.views.push(
			{
				id: "setupForm",
				view:"form",
				elements: [
					{view:"button",	label:"Show Month", id:'setCalendar',type:"form" ,css:"data", click:"showCalendar"}
				]
			}
		);
		dhx.ready(function(){
			dhx.ui.fullScreen();  
			dhx.ui({
				view: "scheduler",
				id: "scheduler",
				save: "mobile_events.php"
			});
			showSetup();
		});

	</script>			

If I change it to

scheduler.config.tab_views.push( it works.

I’m having it initially load the ‘setup’ view which actually contains login information. This example doesn’t need that part to demonstrate the problem though.

Anyway, what’s happening is that it loads the initial setup “view”, but that “view” isn’t part of the Scheduler’s list of tabs, so I don’t get the List/Day/Month options at the bottom of the setup view. When you push the button on the setup view, it should show the month view of the calendar. But, it is unable to do so unless I ‘push’ the setup view into the list of tab_views.

Displaying the view is not enough - it needs to retain functionality with the rest of the Scheduler.

Thank you,
Rob

The scheduler contains few multiview elements, in above code you are placing custom view in top level multiview, but “month” view, which you are using is placed in different multiview, so after your command it really shown in second multiview, but the top multiview is not changed ( sorry for pretty confusing description )

Anyway, you can change code as

function showCalendar(){ $$('scheduler').$$('tabViews').getParent().show(); };

to switch correct multiview.

Or, I can add my custom view to the tab_views with the rest of the views as I originally described,

scheduler.config.tab_views.push({...

and reference it by name along with all of the other views.

I got it working. I was just trying to provide some assistance to the rest of the community, since it wasn’t documented in a fashion that would work.

Thank you,
Rob

i too have attempted to get this demo to work. I am testing 09_custom_style.html from dhtmlxScheduler_mobile_v35_120626.zip

I have tested in IE9 as well as opera mobile.

The code that starts with

scheduler.config.selected_toolbar = [

Is suppose to display an additional button labeled “location”. It does not.

Is there a solution to fix this?

I did try the code change as referenced by the original poster but to no avail.

my mistake . the sample is working.