How to restrct returning on dialog open

Hi

I want to execute some operation onBeforeEventChanged.
below code asking some confomation,if yes open one dialog and choose input inside dialog.My doubt is,before dialog open event returning false.

This is my code

[code] scheduler.attachEvent(“onBeforeEventChanged”, function(ev, e, is_new){
var entercond=1;
if(is_new == false){
if(confirm(“Do you want to shift the current event ?”)){
if(yes){
_htm = “html code”;
$(’#ev_changed_dialog’).html(_htm);
$(’.disable_background’).show();
dialog = $(’#ev_changed_dialog’).dialog({
resizable: false,
width: 230,
show: “slide”,
buttons: {
“Save”: function() {
var v1 = new dataProcessor(“path/connector.php”);
v1.init(scheduler);
v1.setUpdated(ev.id,true);

		 	   $(this).dialog("close");
		 			           $('.disable_background').hide();
		 			return true;
		 		  },
		 		 "cancel": function() {
		 			             	    $('.disable_background').hide();
		 			             	  $(this).dialog("close");
		 			 }
		 		 }
		  });
		 			             	          					
	} 
}else{
	entercond=0;
	}
}

//****************************************************************************************
if(entercond==1){
return true;
}else{
return false;
}
}};[/code]

The only way is to use sync code - that is native window.confirm. Any other dialog will be async, and will not be able to pause the event processing.

You may return false from the event to block the change, but preserve values, and if you have a confirmation from the custom dialog box you can reapply changes through gantt’s api.