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. Image for the cookie policy date
close icon

Custom new/edit form

Hi Syncfusion,

We need to create a completely custom new/edit form for the Gantt control's tasks. We have some logic for which the "addDialogFields" property is not enough (e.g. related dropdowns etc.).
How to hook up into proper events/methods and let the gantt control know of new/edited records?
What would you suggest?

Kind Regards,
Tomasz

1 Reply

JD Jayakumar Duraisamy Syncfusion Team March 9, 2017 05:04 PM UTC

Hi Tomasz, 
We can use custom dialog instead of Gantt default add/edit dialog for add/edit actions. 
This can be achieved by canceling the dialog open action  by using  “actionBegin” client side event  with requestType as “beforeOpenAddDialog”, and also we can initialize custom dialog in this event. 
Please find the code snippet for this. 
$("#GanttContainer").ejGantt({ 
actionBegin: function (args) {                        
                        if (args.requestType == "beforeOpenAddDialog") { 
                            args.cancel = true;                             
                        } 
                    }, 
                    toolbarClick: function(args){                         
                        var itemName = args.currentTarget && args.currentTarget.id; 
                        if (itemName == this._id + "_add") { 
                            $("#customDialog").ejDialog("open"); 
                        } 
                    }, 
}); 
We can add input elements in custom dialog and on save action we can get the data from custom dialog and pass this data to Gantt public methods for required action. 
We have prepared a sample for this and prevent the default add dialog and rendered empty dialog, you can add your own input elements in this dialog. 
Please find the sample from below link. 
 
Currently we can’t use custom edit dialog to update records because currently there is no public method available to update record dynamically. Hence, we have logged a feature report “Update Gantt record values dynamically by using script”. Also we have created a support incident under your account to track the status of this feature. 
Please log on to our support website to check for further updates. 
 
Please let us know if you require further assistance on this. 
Regards, 
Jayakumar D 


Loader.
Live Chat Icon For mobile
Up arrow icon