We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.

Add / Modify Dialog

Thread ID:

Created:

Updated:

Platform:

Replies:

132402 Aug 30,2017 12:33 PM Aug 31,2017 08:46 AM ASP.NET Web Forms 1
loading
Tags: Gantt
Martin Sickel
Asked On August 30, 2017 12:33 PM

Dear All

Is there a way to set the start, end, baselinestart and end dates in the Add and Edit Dialog by a value of my own?

Martin

Suriyaprasanth Ravikumar [Syncfusion]
Replied On August 31, 2017 08:46 AM

Hi Martin, 
            We can achieve this requirement by using “ActionBegin” client side event. This event will be triggered when we open a add/edit dialog with argument “requestType” as“openEditDialog/OpenAddDialog”. 
By using this event we can customize each item available in dialog. We have prepared a sample and updated the startDate,endDate,baselineStartDate and baselineEndDate in this event. 
  
While adding new record, we have performed some internal calculation hence its necessary to update the date values in “args.data" also. 
  
Please refer the following code snippet. 
 
[ASPX] 
 
<ej:Gantt ID="GanttControl" runat="server" EndDateMapping="EndDate" 
                " StartDateMapping="StartDate" DurationMapping="Duration" 
BaselineStartDateMapping="BaselineStartDate" BaselineEndDateMapping="BaselineEndDate" 
                ActionBegin="actionBegin" ...> 
</ej:Gantt> 
 
<script type="text/javascript"> 
         //Event trigger at the add/edit dialog. 
            function actionBegin(args) { 
 
                if (args.requestType == "OpenAddDialog") { 
 
                    $("#GanttControlstartDateAdd").ejDatePicker('model.value', '10/27/2013'); // $("# + control ID + Field + Add") 
                    $("#GanttControlendDateAdd").ejDatePicker('model.value', '11/01/2013'); 
                    args.data.startDate = '10/27/2013'; 
                    args.data.endDate = '11/1/2013'; 
                    args.data.duration = parseFloat($("#GanttControldurationAdd").val()); 
                    $("#GanttControlbaselineStartDateAdd").ejDatePicker('model.value', '10/27/2013'); 
                    $("#GanttControlbaselineEndDateAdd").ejDatePicker('model.value', '10/30/2013'); 
 
                } 
 
                if (args.requestType == "openEditDialog") { 
 
                    $("#GanttControlstartDateEdit").ejDatePicker('model.value', '10/27/2013'); // $("# + control ID + Field + Edit") 
                    $("#GanttControlendDateEdit").ejDatePicker('model.value', '11/01/2013'); 
                    $("#GanttControlbaselineStartDateEdit").ejDatePicker('model.value', '10/27/2013'); 
                    $("#GanttControlbaselineEndDateEdit").ejDatePicker('model.value', '10/30/2013'); 
 
                } 
 
            } 
 
        </script> 
 
 
We have prepared a sample as per your requirement, please find the sample location below. 
Please let us know if require further assistance on this. 
Thanks, 
Suriyaprasanth R. 


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;