read-only ligthtbox

I have tried varous suggestion and blocks of dragging, but I cannot seem to get a solution where on a read-only view, on double click the lightbox is visible, but the event is not editable or deletable. I have tied as suggested on prior posts:

//block all modifications
scheduler.attachEvent(“onBeforeDrag”,function(){return false;})
scheduler.attachEvent(“onClick”,function(){return false;})
scheduler.config.details_on_dblclick = true;
scheduler.config.dblclick_create = false;

and comented out the following lines to prevent back-saving

//var dp = new dataProcessor("…/php/filename.php");
//dp.init(scheduler);

But it still allows deleting of an event upon lightbox display. Any suggestions?

thanks,

I thought it’s a good way to invoke “Cancel Button” function in “Save Button” and “Delete Button” if you detect this event was a readonly one.

You can use onBeforeEventDelete as suggested above, or you can use readonly-view extension, which is available starting from scheduler 2-1

docs.dhtmlx.com/doku.php?id=dhtm … donly_view

samples\03_extensions\12_readonly_form.html
samples\03_extensions\14_readonly_event.html

Judo,
How do I change the save and delete buttons to cancel? Thanks,

Here was my code how to deal with the event when I detect resources collision:

			case "dhx_save_btn":
			    scheduler.form_blocks["time"].get_tmp_value(document);
				var isCollision = scheduler.getConllisionInfor(scheduler._lightbox_id, currentStart, currentEnd);
			    if (!isCollision){				    
					if (scheduler.checkEvent("onEventSave") && !scheduler.callEvent("onEventSave",[scheduler._lightbox_id,scheduler._lightbox_out({})]))
							return;
					scheduler._empty_lightbox()
					scheduler.hide_lightbox();
				} else {
					scheduler.callEvent("onEventCancel",[scheduler._lightbox_id]);
				    scheduler._edit_stop_event(scheduler.getEvent(scheduler._lightbox_id),false);
				    scheduler.hide_lightbox();
				}
				break;

Best wishes,

Judo

I tried the javasript read_only form extension, and I have a complex rather customized lightbox. It fails to work in this setting, even with a revised downloaded version.

May be you can try to use “OnEventSave” event. If it return false, all your changes didn’t take effect, eithwise saved your change.

Judo

The following can be used to make detail form read-only:
scheduler.config.readonly_form = true;

It shows only cancel button in custom form, but only if form was customize by scheduler.form_blocks object.

The readonly_form fails to allow the lightbox to be seen when I double click. Here is my customized ligthbox code.

//scheduler.config.readonly=<?php echo $READ_ONLY ?>;
scheduler.config.readonly_form =<?php echo $READ_ONLY ?>;
//scheduler.config.multi_day=1;
scheduler.config.time_step = 30;
scheduler.config.xml_date="%Y-%m-%d %h:%i%a";
scheduler.config.hour_size_px=75;
scheduler.config.lightbox.sections=[
{name:“prolength”, height:23, type:“my_select”, options:procedure, map_to:“section2_id” },
{name:“description”, height:50, map_to:“text”, type:“textarea”, focus:true},
{name:“notes”, height:100, type:“textarea” , focus:true, map_to:“details” },
{name:“status”, height:23, type:“select”, options:sections, map_to:“section_id” },
{name:“loc”, height:23, type:“select”, options:sections1, map_to:“section_id1” },
{name:“time”, height:72, type:“time”, map_to:“auto”}
]

Same configuration works correctly locally ( except of type:“my_select” - which is not default, so it can’t be checked locally )

Is it possible for me to delete the trash icon, i.e. will this line work:

scheduler.config.icons_select:[“icon_trash”,“icons_delete”];

thanks,

The original button collection looks as

scheduler.config.icons_select=[“icon_details”,“icon_edit”,“icon_delete”];

You can change order, remove any of them, or add a custom one

//without delete icon
scheduler.config.icons_select=[“icon_details”,“icon_edit”];