Hide Selection Menus

Hi,
Is it possible to hide a Selection Menu in the dhtmlxScheduler component?

When an event is focused, the Selection Menus appears on the left side of the event.
Is there some way to “shut down” this functionality? :astonished:

Thanks!

Hello,

you can block menu by onClick event handler:

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

Great! :slight_smile:
There is an empty space on the left side of the event (allocated for the Selection Menu).
Is it possible to make events to fill this empty space?

Thanks!

Is it possible to make events to fill this empty space?

Unfortunately it isn’t possible. This space is hardcoded and necessary to create new events in the period of existent events.

Ok,
Thanks!

Hi

I have had the similar problem. and I fixed it by above solution. but somehow when I am trying to access that event in agenda or year view its not opening. and when I remove the restriction on onClick event. selection menu is showing up in week and day mode which is undesirable in my case.

I have attached the file please have a look @ it. problematic area has been surrounded by below text

function allow_own(id){
var ev = this.getEvent(id);
//alert(ev.userId+’—’+’<%=superUser%>’ +’—’+ <%=!restrictedMode%>)
//alert(ev.userId==’<%=superUser%>’ && <%=!restrictedMode%>)
if(<%=!restrictedMode%>){
if(ev.userId==’<%=superUser%>’){
return true;
}else{
return false;
}
}else{
return false;
}
//return ev.userId==’<%=superUser%>’ && <%=!restrictedMode%>;
}

          scheduler.attachEvent("onViewChange", function (mode , date){
          		if (this._mode == "day" || this._mode == "week"){
      				//scheduler.attachEvent("onDblClick",allow_own);
          			scheduler.attachEvent("onClick",allow_own);

   				}else{

           			//scheduler.attachEvent("onClick",true);
           			//scheduler.attachEvent("onDblClick",true);
       			}

		 });

scheduler.attachEvent(“onBeforeLightbox”, function (event_id){
var current_event=scheduler.getEvent(event_id);

            /*Disabling time Event name for non owners*/
            scheduler.form_blocks.textarea.set_value=function(node,value){
                node.firstChild.value=value||"";
                if(current_event.userId!='<%=superUser%>'){
                    node.firstChild.disabled = true;
                    // or just = true; to disable for all events
                }else{
                    node.firstChild.disabled = false;
                }
            }

           /*User should see only his events*/
            if(current_event.userId!='<%=superUser%>' || <%=restrictedMode%>){
                current_event.readonly = true;
                scheduler.attachEvent("onBeforeDrag",function(){return false;});
                scheduler.config.drag_move=false;
            }else{
                current_event.readonly = false;
                scheduler.config.drag_move=true;
                scheduler.attachEvent("onClick",true);
           //scheduler.attachEvent("onDblClick",true);
            }

            scheduler.form_blocks.link.set_value=function(node,value){
                var url=current_event.url;
                
                if(current_event.url){
                    if(current_event.source && current_event.source!='calendar'){
                        url='http://'+window.location.hostname+current_event.url;
                    }else{
                        url=get_url(current_event.url);
                    }
                    lessonurl=url;
                    //node.innerHTML='<a href="'+url+'" target="_blank">'+current_event.text+'</a>';
                    node.innerHTML='<a href="javascript:openLesson()">'+current_event.text+'</a>';
                }else{
                    node.innerHTML='<textarea></textarea>';
                }
            }


            return true;
            //any custom logic here
        });

The next is incorrect

scheduler.attachEvent("onViewChange", function (mode , date){ if (this._mode == "day" || this._mode == "week"){ scheduler.attachEvent("onClick",allow_own);

attachEvent adds new handler, but not removes previous one, so this handler will not be removed when mode changed to some other value.

You need to assign handler only once and check mode value from allow_own ( or similar ) function

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

The above function is not working for me. I am trying to hide left menu based on some event properties. How can i implement this?

Thanks in advance
Shiju

@Shiju:- Would you care to explain? and If possible give us a look of code snippet.

The problem is there is an extra space beside the word ‘onClick’:

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

here’s it is without the space:

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

Wonder if it would be good to turn the onclick into a double click? Wonder if how to do it.