DHTMLScheduler - onEventAdded and onClick on the Month View

I have both of these events set up in my code and they work perfectly in the Day and Week views but not the Month view. All of my other events seem to be working in the Month view



Any Idea what I am doing wrong?







-----------------------------------------



    function init() {

        scheduler.config.xml_date="%Y-%m-%d %H:%i";    

        scheduler.config.first_hour = 8;

        scheduler.config.last_hour = 18;    

        var sugar_calendar_date = Get_Cookie(‘sugar_calendar_date’);

        var sugar_calendar_view = Get_Cookie(‘sugar_calendar_view’);

        var myDate=new Date(sugar_calendar_date)



        scheduler.init(‘scheduler_here’,myDate,sugar_calendar_view);

        scheduler.config.time_step = 15;

        //scheduler.setCurrentView(myDate, “month”)

        scheduler.attachEvent(“onEventAdded”, function(event_id,event_object){

            //alert(event_id);

            //start_date

            //end_date

            //text

            //id

            //Wed Sep 02 2009 10:35:00 GMT-0500 (CST)

            //dumpProps(event_object);

            //alert(event_object.text)

            //window.open(“index.php?module=Calendar&action=test&to_pdf=1”)    

            window.location=“index.php?module=Calendar&action=test&to_pdf=1&name=”+event_object.text+"&start_date="+event_object.start_date+"&end_date="+event_object.end_date;        

});    

        scheduler.attachEvent(“onViewChange”, function (mode , date){

            Set_Cookie(‘sugar_calendar_view’,mode,30,’/’,’’,’’);

            Set_Cookie(‘sugar_calendar_date’,date,30,’/’,’’,’’);

        });

        

        scheduler.attachEvent(“onClick”, function (event_id, native_event_object){

            var type=event_id.substring(0,1);

            var id=event_id.substring(1);

            if(type==‘c’) {

                parent.window.location=“index.php?return_module=Calendar&return_action=index&module=Calls&action=EditView&record=”+id;

            }

            if(type==‘m’) {

                parent.window.location=“index.php?return_module=Calendar&return_action=index&module=Meetings&action=EditView&record=”+id;

            }

            return false;

        });

        

        scheduler.attachEvent(“onEventChanged”, function(event_id,event_object){

            //create data to send across

            postData = “index.php?to_pdf=1&module=Calendar&action=MoveEvent&start_date=”+event_object.start_date+"&end_date="+event_object.end_date+"&record="+event_object.id;

//            //create callback function

            var callback =    {

                //on success, refresh list

                 success: function(o) {

                     //var targetdiv=document.getElementById(‘selected_directory_children’);

                        //targetdiv.innerHTML=o.responseText;

                        //SUGAR.util.evalScript(o.responseText);

                        parent.ajaxStatus.flashStatus(‘Event Updated’, 2000);

                 },

                 //do nothing on failure

                 failure: function(o) {/failure handler code/}

            };

//            //make ajax call

            var trobj = YAHOO.util.Connect.asyncRequest(‘GET’,postData, callback, null);

        });

        

        scheduler.attachEvent(“onXLE”,function(){

         scheduler.render_view_data();

        });        

        

        scheduler.templates.event_header=function(start,end,event){

            return “”+scheduler.templates.hour_scale(start);

        }

//        scheduler.templates.event_text=function(start,end,event){

//         return “”+event.parent.substring(0,18)+"
"+event.text;

//        }        

        scheduler.load(“cache/modules/Calendar/test.xml”);

    }

but not the Month view
Both events are working in month view correctly.
Attached sample is using the same code as was provided in your post and still both events are working in month view.( from code perspective - they must work for any mode )
Please beware that onclick event may skipped when you are clicking on custom images in event’s header

127392187.ZIP (35.9 KB)

OK, Re-testing again today confirms what you said, it must have been a caching problem or something yesterday.  But on the Month view when creating a multiday event, is there a way to make is skip the lightbox and just run the ‘onEventAdded’ event?

Can be done as
scheduler.config.edit_on_create = false;