transpose_0 is not a function

Hello,

I’ve got the following function to put a schedule on my page:

	function maakScheduler(){
		
	tabbar.cells("scheduler").attachScheduler(new Date(),"month","scheduler_here");
	
		scheduler.config.xml_date="%Y-%m-%d %H:%i";
		scheduler.config.prevent_cache = true;
		
            var control_date = new Date();
            scheduler.templates.event_class=function(start, end, event){

                if(event.subject) // if event has subject property then special class should be assigned
                    return "event_"+event.subject;

                return ""; // default return

            };

		
            var subject = [
                { key: 'afspraak', label: 'Afspraak' },
                { key: 'training', label: 'Training' },
                { key: 'interview', label: 'Interview/Gap-analyse' },
                { key: 'intern', label: 'Vergadering/belsessie/interne opleiding' },
				{ key: 'afwezig', label: 'Afwezig/vakantie/privé' }
            ];

	
		scheduler.config.lightbox.sections=[	
			{name:"description", height:130, map_to:"text", type:"textarea" , focus:true},
			{name:"subject", height:20, type:"select", options: subject, map_to:"subject" },
			{name:"type", height:21, type:"select", map_to:"rec_type", options:[
				{ key:0, label:"Zakelijk" },
				{ key:1, label:"Privé" }
			]},
			{name:"time", height:72, type:"time", map_to:"auto"}
		]
		scheduler.config.first_hour=8;
		scheduler.locale.labels.section_subject="Soort item";
		scheduler.locale.labels.section_type="Zakelijk/Persoonlijk";
		scheduler.config.details_on_create=true;
		scheduler.config.details_on_dblclick=true;
		
		scheduler.load("connectors/events.php?user="+franchiser);
		scheduler.load("connectors/events_shared.php");
		
		
		//allow edit operations only for own events
		function allow_own(id){
			var ev = this.getEvent(id);
			return ev.userId == franchiser;
		}
		scheduler.attachEvent("onClick",allow_own);
		scheduler.attachEvent("onDblClick",allow_own);

		//default properties of new event
		scheduler.attachEvent("onEventCreated",function(id){
			var ev = this.getEvent(id);
			ev.userId = franchiser; //just for rendering on client, will not affect server data
		});
		scheduler.templates.event_bar_text=scheduler.templates.event_text=function(start,end,event){
			return "["+event.userId+"] "+event.text;
		}
		
		var dpScheduler = new dataProcessor("connectors/events.php?user="+franchiser);
		dpScheduler.init(scheduler);

//refresh data after saving
		dpScheduler.attachEvent("onAfterUpdate", function(sid, action, tid, details){
     	if (action == "update")
			scheduler.load("connectors/events.php?user="+franchiser);
			scheduler.load("connectors/events_shared.php");
		});
	}

Everything works fine. But as soon as I add

<script src="codebase/ext/dhtmlxscheduler_recurring.js"></script>

in the head section of my file, the scheduler doesn’t populate with existing events, nor can I add new events.

What am I doing wong here?

I should have added that Chrome shows the following error:
Uncaught TypeError: Property ‘transpose_0’ of object # is not a function

Regards,
Kees

Please be sure that rec_type property of event is correctly field

  • varchar field rec_type exist in DB
  • it is correctly configured in connector

It seems taht you have a “0” as value of rec_type - which is a wrong value

Stanislav,

Thanks for pointing that out for me. :blush:

It works now.

Regards,
Kees