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

Saving additional Non-default property

Hi there,

I have a requirement where I have few more additional properties to save along with Gantt's task.  For example Tasks are associated with a parent project.  Gantt chart for individual projects are meant to be seen access through URL e.g. /tasks/projectId=2.  Now I want to associate new tasks with the project (project id).  Is there a cleaner way to achieve this i.e. using the Query property (I have done this with links girds etc, but having trouble with Gantt), so in the corresponding Add & Update controller methods other than viewmodel object an additional parameter (e.g. projectId) could be passed on.  Or is there any otherway

Also to show additional properties I believe you can use .AddDialogFields() .EditDialogFields() methods to show the non-default fields, however how can you keep the original fields while adding new fields to the bottom of the add/edit task dialog.

Regards
Prasanthan

1 Reply

JD Jayakumar Duraisamy Syncfusion Team December 15, 2015 04:10 AM UTC

Hi Prasanthan,
Thanks for using Syncfusion Product.

Query
Solution
1
Gantt chart for individual projects are meant to be seen access through URL e.g. /tasks/projectId=2.  Now I want to associate new tasks with the project (project id). 
Using Load action method add non-default columns at the load time.

columns.splice(0, 0,

        {

            field: "ProjectId",

            headerText: "ProjectID",

            mappingName:"ProjectId",

            columnTemplate: true,

            templateId: "columnTemplate",

            width: "200px"
        });

2
 Is there a cleaner way to achieve this i.e. using the Query property (I have done this with links girds etc, but having trouble with Gantt), so in the corresponding Add & Update controller methods other than viewmodel object an additional parameter (e.g. projectId) could be passed on. 
By using ajax post, we can Add or Update Controller methods.

$.ajax({

      type: "POST",

      url: "/Gantt/Add                   

      data: ganttRecord,

      ataType: "json"
       });

3
Show additional properties I believe you can use .AddDialogFields() .EditDialogFields() methods to show the non-default fields, however how can you keep the original fields while adding new fields to the bottom of the add/edit task dialog.
Once we add non-default columns at the load time then no need to use in AddDialogFields or EditDialogFieds method. When add new fields then it will dynamically add to the bottom of the original fields in add/edit dialog


We have also prepared a sample with fulfil your queries. Please find the sample in the following URL.

Sample URL: http://www.syncfusion.com/downloads/support/forum/121422/ze/MVCsampleSQL1132617458
Please let us know if you require further assistance on this.

Regards

Jayakumar Duraisamy

Loader.
Live Chat Icon For mobile
Up arrow icon