Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by mahesh on Oct 24, 2009 13:15
open dhtmlx forum
mouse click on month view to bring up details section

1. Is there a way to make a single mouse click bring on the details menu rather than a double click?

2. A variant of a prior question of mine related to above.
a) Can I make a single click change the default time from midnight to 8 AM to 9 AM and
b) Can I make a double click change the default time to 12 noon to 1 PM.
The above would aid in conference scheduling.

thanks,
-Mahesh
Answer posted by Stanislav (support) on Oct 26, 2009 10:23
>>1. Is there a way to make a single mouse click bring on the details
scheduler.attachEvent("onClick",function(id,e){
       scheduler._on_dbl_click(e);
       return false;
})

>>2. A variant of a prior question of mine related to above.
You can use onClick and onDblClick event handlers to assign any custom reaction on single and double-clicking.
Answer posted by mahesh on Oct 26, 2009 13:31
I will work on it.  I need to figure out how to set the times on clicking.  When I tried something earlier, and then did day view and clicked and dragged to set an event time it then exhibited peculiar behaviour , so it may be in order to implement thick clicking has to differ depending on the view which may it more complicated than it is worth.
Answer posted by mahesh on Oct 26, 2009 15:21

Stan,

  I tried:

scheduler.attachEvent("onClick",function(id,e){
       scheduler._on_dbl_click(e);
       return false;
})

On month view, a single click fails to bring up the event window.

Answer posted by Alex (support) on Oct 27, 2009 07:43

Hello,

locally the same approach correctly works. 

Possibly some custom code causes the problem.

Answer posted by mahesh on Oct 27, 2009 11:39

Here is what I have:  It looks like it should work.

   -Mahesh

 

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<head>
 <meta http-equiv="Content-type" content="text/html; charset=utf-8">
 <title>Conference schedule</title>
</head>
 <script src="../../codebase/dhtmlxscheduler.js" type="text/javascript" charset="utf-8"></script>
 <link rel="stylesheet" href="../../codebase/dhtmlxscheduler.css" type="text/css" title="Conference schedule"
charset="utf-8">
        <div id="scheduler_here" class="dhx_cal_container" style='width:100%; height:100%;'>


 
<style type="text/css" media="screen">
 html, body{
  margin:0px;
  padding:0px;
  height:100%;
  overflow:hidden;
 } 
</style>

<script type="text/javascript" charset="utf-8">
 function init() {
       
        //scheduler.config.readonly=1;
                //scheduler.config.show_loading=true;


                scheduler.config.multi_day=0;
                scheduler.config.xml_date="%Y-%m-%d %H:%i";
                scheduler.config.hour_size_px=75;
  scheduler.config.lightbox.sections=[ 
   {name:"description", height:80, map_to:"text", type:"textarea" , focus:true},
   {name:"location", height:60, type:"textarea", map_to:"details" },
   {name:"time", height:72, type:"time", map_to:"auto"}
  ]
  
                scheduler.config.first_hour=7;
                scheduler.config.last_hour=19;
                scheduler.config.hour_date="%h:%i%A";

                //Allow for single click mode
                scheduler.attachEvent("onClick",function(id,e){
                scheduler._on_dbl_click(e);
                return false;
})


  scheduler.locale.labels.section_location="Notes";

               
    //Try to automate defaults on start and end time, but buggy
                //scheduler.config.details_on_create=true;
  //scheduler.config.details_on_dblclick=true;

                //scheduler.attachEvent("onEventCreated",function(id,e){
                //var date = scheduler.getEvent(id).start_date;
                //date.setHours(8);
                //var date = scheduler.getEvent(id).end_date;
                //date.setHours(9);
                //scheduler.getEvent(id).end_date =  date;              
                // }

 
  scheduler.init('scheduler_here',null,"month");
  scheduler.load("php/conf_events.php?uid="+scheduler.uid());
  
  var dp = new dataProcessor("php/conf_events.php");
  dp.init(scheduler);

 }
</script>

<body onload="init();">
 <div id="scheduler_here" class="dhx_cal_container" style='width:100%; height:100%;'>
  <div class="dhx_cal_navline">
   <div class="dhx_cal_prev_button">&nbsp;</div>
   <div class="dhx_cal_next_button">&nbsp;</div>
   <div class="dhx_cal_today_button"></div>
   <div class="dhx_cal_date"></div>
                        <div style="right:400px;color:red;">ADMIN MODE: Conference Schedule</div>
   <div class="dhx_cal_tab" name="day_tab" style="right:204px;"></div>
   <div class="dhx_cal_tab" name="week_tab" style="right:140px;"></div>
   <div class="dhx_cal_tab" name="month_tab" style="right:76px;"></div>
  </div>
  <div class="dhx_cal_header">
  </div>
  <div class="dhx_cal_data">
  </div>  
 </div>
</body>

Answer posted by Alex (support) on Oct 28, 2009 02:51

hello,

it works. The sample is attached 

Attachments (1)
sample.zip36.83 Kb
Answer posted by mahesh on Oct 28, 2009 15:38

I tried the sample without changing anything.  It does not work on my system?  Can it be browser dependent?

  

Answer posted by Alex (support) on Oct 29, 2009 02:30

Hello,

how did you try to open the sample ? Locally it works in all browsers.

Answer posted by mahesh on Oct 29, 2009 08:43
I just extracted locally to my hard drive, and then launched in internet explorer 7.  On month view single click does nothing, double click brings up 12:05 AM.  I assume we are debigging the single dlick / double click issue, and at this point not the time issue. Thanks,
Answer posted by Alex (support) on Oct 30, 2009 05:58
The sample has been tested on different machines in IE7. The issue wasn't reproduced.
Try to test the sample on other computer - possibly the problem is caused by some plug-ins.
Answer posted by mahesh on Nov 08, 2009 13:29

Stan,

    You are correct:  The single click works on an event that already exists.   But, If an event does not exist on the month calendar view, then a single click will not enable creastion of an event which is what I am interested in happening.

 

Answer posted by Alex (support) on Nov 09, 2009 06:41

You can try to use the following method:

var setter = scheduler._click.dhx_cal_data;

scheduler._click.dhx_cal_data = function(e){   
  scheduler._on_dbl_click(e||event)
  setter.apply(this,arguments);
}


It should be called before init() method