This is a migrated thread and some comments may be shown as answers.

Gantt - how to handle task assignment updates?

3 Answers 147 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Al
Top achievements
Rank 1
Iron
Iron
Iron
Al asked on 18 Mar 2021, 10:35 AM

If possible, please point me to a working example of this using remote data source. My config as below:

    <ganttdatasource ref="ganttdatasource1"
                            :transport-read="ganttRead"
                            :transport-update="ganttUpdate"
                            :transport-create="ganttCreate"
                            :transport-destroy="ganttDestroy"
                            :transport-parameter-map="parameterMap"                           
                            :transport-batch="true" 
                            schema-model-id="id"
                            :schema-model-fields="fields">
    </ganttdatasource>

        <gantt
            ref="kendogantt"
            id="gantt"
            :height="500"
            :editable-create="true"         
            data-source-ref="ganttdatasource1"            
            :assignments="assignments"          
            :resources="resources"
        >
        </gantt>

 

 

I'm using the gantt with remote data with custom functions (I use axios, not Telerik gantt data source built-in features). When the gantt first loads it gets it's tasks from  'transport-read', task resource assignments from 'assignments' prop, and resources from 'resources' prop. All works just fine.

 

Now when a task's assignment is updated, it triggers my custom function 'ganttUpdate', it passes in a data object with all the task data + a .resources. property that has all the assignments for the task and I can update my backend ok.

What I don't understand is what I need to return from 'ganttUpdate' - I mean there are now two places where the task resource assignments are kept (1) on the task itself in the .resources property, and (2) on the gantt in the 'assignments' prop (which has all the assignments for all tasks). It is very confusing.

3 Answers, 1 is accepted

Sort by
0
Petar
Telerik team
answered on 23 Mar 2021, 08:42 AM

Hi Al,

You have to return the task itself like it is demonstrated in our Kendo UI for jQuery examples. As the Gantt is a wrapper component of the Kendo UI for jQuery, the same approach is applicable for it.

Start this Dojo example and open the network tab of your browser. Edit a random task. Click on the request that will appear and then select "Response". In this response, you will see data of the edited task with the updated values. 

Let me know if the above answers your question.

Regards,


Petar
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

0
Al
Top achievements
Rank 1
Iron
Iron
Iron
answered on 23 Mar 2021, 10:15 AM

Thanks Petar, following your instructions it appears that I don't need to pass any of the resource assignment info back, only the basic task information.

Obviously the updated assignment data would need to be loaded via :assignments prop when the gantt reloads

0
Petar
Telerik team
answered on 23 Mar 2021, 02:51 PM

Hi Al,

I am happy to hear that the details I sent you have helped you implement what you need in your app. 

Regards,
Petar
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

Tags
General Discussions
Asked by
Al
Top achievements
Rank 1
Iron
Iron
Iron
Answers by
Petar
Telerik team
Al
Top achievements
Rank 1
Iron
Iron
Iron
Share this question
or