kwib
            
          
          
          
              
              
          #1
          
         
        
          Hi,
I wanted to use the customized add event form such that the default one will not appear.
How can I do that?
I tried to call blockevent() and other related hits in the forum but none of them works.
I’m using the following code…
$$("scheduler").$$("add").attachEvent("onItemClick", function (id, ev, trg) {
			showCustomizedWindow();
		});
Thanks,
         
        
          
        
           
           
           
         
         
            
            
          
       
      
        
        
          Hi,
you can redefine configuration of the toolbar in the bottom of the scheduler and use own button instead of default “add” button:
var labels = scheduler.locale.labels;
scheduler.config.bottom_toolbar = [
   { view:"button",id:"today",label:labels.icon_today,inputWidth:scheduler.xy.icon_today, align:"left",width:scheduler.xy.icon_today+6},
  { view:"segmented", id:"buttons",selected:"list",align:"center",multiview:true, options:[
	{value:"list", label:labels.list_tab,width:scheduler.xy.list_tab},
	{value:"day", label:labels.day_tab,width:scheduler.xy.day_tab},
	{value:"month", label:labels.month_tab,width:scheduler.xy.month_tab}
  ]},
  { view:"button",css:"add",id:"newAdd", align:"right", label:" + ", inputWidth:42, width:50},
  { view:"label", label:"",inputWidth:42,width:50, batch:"readonly"}
];
The event handler should be set for the new button:
$$("scheduler").$$("newAdd").attachEvent("onItemClick", function (id, ev, trg) {
         showCustomizedWindow();
 });
         
        
        
           
           
           
         
         
            
            
          
       
      
        
        
          blockEvent also will do. However, you need to call it for $$(“scheduler”):
$$("scheduler").$$("add").attachEvent("onItemClick", function (id, ev, trg) {
       $$("scheduler").blockEvent();
       showCustomizedWindow();
       dhx.delay(function(){
             $$("scheduler").unblockEvent();
      });
});
         
        
        
           
           
           
         
         
            
            
          
       
      
        
          
          
            kwib
            
          
          
          
              
              
          #4
          
         
        
          Thanks for the reply,
I’ve used the blockEvent() way.
         
        
        
           
           
           
         
         
            
            
          
       
      
        
          
          
            kwib
            
          
          
          
              
              
          #5
          
         
        
          another follow up question…
I was trying to do the same thing for opening existing appointment form, and used the following method but to no avail…any ideas?
		$$("scheduler").$$("dayList").attachEvent("onItemClick", function (id) {
			$$("scheduler").blockEvent();
			showCustomizedWindow(id);
			dhx.delay(function () {
				$$("scheduler").unblockEvent();
			});
		});
Thanks,
         
        
        
           
           
           
         
         
            
            
          
       
      
        
        
          This approach doesn’t fit in this case. Please take a look at the post with the issue similar to yours:
viewtopic.php?f=24&t=27854