double click event in asp.net mvc schedule

hi,
I have downloaded sample project for asp.net mvc4 scheduler.
What I want is,If user double click on the schedule,I don’t want to display the Lightbox,How can I define this in my view page and in which action I have to define it?
Index.cshtml in" MVCFormInLIghtBox",I have defined like
@{
ViewBag.Title = “Scheduler | MVC Form in lightbox”;
ViewBag.SampleTitle = “MVC Form in lightbox”;
ViewBag.ShortDescription = “Custom lightbox form”;
ViewBag.LongDescription = “Try to edit event”;
}

alert(“In light box script”);
scheduler.attachEvent(“onDblClick”,function(){
alert(“In double click”);
return true;
});

</script>
<style type="text/css">
    .custom_lightbox
    {

    }
</style>

@Html.Raw(Model.Render())

In this Dbl click event is not firing,even alert is also not coming.how can I fire this event as well as I don’t want to show the lightbox.

Hi,
if you want to disable event creation on double-click, you could use related config
DHXScheduler.Config.dblclick_create = false;
or to prevent opening lightbox on double click on event:
DHXScheduler.Config.details_on_dblclick = false;

As for custom code, it will work if you place it after Model.Render()
Currently it’s being executed before scheduler is loaded to the page and causes js error.

hi,
Thanks for the reply,

If i gave like this,This is showing DHXscheduler is not defined.
Actually my requirement is,
I have a left tab and right tab,
In the left tab I have a scheduler,when I double click on a particular schedule,I have to display the details of that schedule on the right side tab.
can u provide a sample code for this.

Thanks.

If i gave like this,This is showing DHXscheduler is not defined.
I meant DHXscheduler class. You should change config of the scheduler in the controller
e.g:public virtual ActionResult Index() { var scheduler = new DHXScheduler(this); scheduler.Config.dblclick_create = false;

In the left tab I have a scheduler,when I double click on a particular schedule,
I have to display the details of that schedule on the right side tab.
check scheduler’s onClick event, you can use it to catch click on a schedule
docs.dhtmlx.com/doku.php?id=dhtm … nt_onclick

scheduler.attachEvent("onClick", function (event_id){ var ev = scheduler.getEvent(event_id); //do something with the schedule });

hi,
Onclick event is not firing.
I gave like
scheduler.attachEvent(“onClick”, function () {
alert(“In onclick”);
});

please provide the full code. There is no known problems with inner events of the scheduler.
Code from your first post didn’t work because scheduler.attachEvent was called before scheduler was defined on the page. Is there any chance that the same is happening with your current code?

hi,
I have sent the code in the following attachment.and can u provide sample code for my requirement as described above.
controller code:
public ActionResult Index()
{
var sched = new DHXScheduler(this);
sched.Skin = DHXScheduler.Skins.Terrace;
sched.Config.multi_day = true;
sched.InitialDate = new DateTime(2011, 9, 19);
sched.Config.dblclick_create = false;
sched.Config.details_on_dblclick = false;
sched.Extensions.Add(SchedulerExtensions.Extension.PDF);
//load data initially
sched.LoadData = true;
//save client-side changes
sched.EnableDataprocessor = true;
return View(sched);
}
public ActionResult Data()
{
return View();
}

view code:

@{ ViewBag.Title = "Scheduler | Basic initialization"; ViewBag.SampleTitle = "Basic initialization"; ViewBag.ShortDescription = "See how scheduler can be initialized"; ViewBag.LongDescription = "Drag or double-click to create new event Double-click on existing events to edit them, or drag them to change their time."; } @Html.Raw(Model.Render())
Title:
            Description:<input type="text" />

            startTime:
         EndTime:
        </div>
    </div>
    $(document).ready(function () {
        var tabbar = new dhtmlXTabBar("a_tabbar", "right");
        tabbar.addTab("a1", "EditSchedule", "100px");
        tabbar.setContent("a1", "content");
        scheduler.attachEvent("onClick", function () {
            alert("In onclick");
           tabbar.setTabActive("a1");
        });
   });
</script>

Here is the example,
‘onClick’ event seems working here
s3.amazonaws.com/uploads.hipcha … _split.zip

To link calendar with form, you’ll need following methods of the scheduler:
New event can be created with scheduler.addEvent method:
docs.dhtmlx.com/doku.php?id=dhtm … r_addevent

To retrieve existing event by id(which is passed to ‘onClick’ handler), you should use scheduler.getEvent[code]scheduler.attachEvent(“onClick”, function(id){
var event = scheduler.getEvent(id);
//fill form with event data

});[/code]
If you updating event with data from the form, you should use scheduler.updateEvent to redraw event in the calendar:var event = scheduler.getEvent(id); event.text = "new text"; scheduler.updateEvent(id);http://docs.dhtmlx.com/doku.php?id=dhtmlxscheduler:api_method_dhtmlxscheduler_updateevent

And thats pretty it,
also you may need helpers to convert date to string and vice versa:[code]var dateToString = scheduler.date.date_to_str("%d-%m-%Y %H:%i");
var string = dateToString(event.start_date);

var stringToDate = scheduler.date.str_to_date("%d-%m-%Y %H:%i");
var date = stringToDate(string);[/code]Here is some info about date formats
docs.dhtmlx.com/doku.php?id=dhtm … ngs_format

hi,
It is working fine,
I need two more things,
1.If there is no schedule and user double click on specific time,I need to active the right tab .
user enters the values and click on save,I need save it in database.
2.Is it possible to create schedule within schedule.