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

Customization of week header and task moving

Hi,

I have two questions about the Gantt control :

1) Is it possible to make a week starting a Monday, currently a week is starting a Saturday ?

2) Is there a way to make a task to always fill a week (by moving or resizing it) ?

Thanks, Rémi.

5 Replies

MK Mahalakshmi Karthikeyan Syncfusion Team July 13, 2015 05:31 PM UTC

Hi Remi,

Please find the response below.

Query 1: 1) Is it possible to make a week starting a Monday, currently a week is starting a Saturday ?

Solution: Currently there is no support to customize the week’s start day in Gantt control. We have already logged feature regarding this. A support incident has been created under your account to track the status of this requirement. Please log on to our support website to check for further updates.

https://www.syncfusion.com/account/login?ReturnUrl=/support/directtrac/incidents

Please let us know if you require further assistance on this.

Query 2: Is there a way to make a task to always fill a week (by moving or resizing it) ?

Solution: We can fill week by resizing the taskbar in the month ScheduleHeaderType and DurationUnit as “day”. Please find the below code snippet to render the gantt in month schedule header type.

<form id="form1" runat="server" onsubmit="return false" style="overflow: hidden; padding:0; margin: 0;height:100%;width:100%;">       

    <ej:Gantt ID="Gantt" runat="server"

              DurationUnit="day"

              AllowGanttChartEditing="true"

      //…>

      <ScheduleHeaderSettings ScheduleHeaderType= "month" MonthHeaderFormat="MMM yyyy"  

       WeekHeaderFormat="M/dd"></ScheduleHeaderSettings>

    </ej:Gantt>      

</form>

We have also prepared a sample based on this and you can find the sample under the following location.

Sample: http://www.syncfusion.com/downloads/support/forum/119582/ze/MonthscheduleHeader426434478

Is this your requirement or else please revert back to us by modifying this sample

Regards,

Mahalakshmi K.



Rémi July 15, 2015 10:05 AM UTC

Thanks for your reply.


I would like to force the task to start a monday and end a sunday, so I did the following :


function ActionComplete(args) {

            var tache = args.item;

            if (tache != null) {

                var dtDebut = new Date(tache.Start);

                var dtFin = new Date(tache.End);

                if (dtDebut.getDay() != 1) {

                    dtDebut.setDate(dtDebut.getDate() - dtDebut.getDay() + 1);

                    tache.Start = (dtDebut.getMonth() + 1) + "/" + dtDebut.getDate() + "/" + dtDebut.getFullYear();

                }

                if (dtFin.getDay() != 0) {

                    dtFin.setDate(dtFin.getDate() - dtFin.getDay());

                    tache.End = (dtFin.getMonth() + 1) + "/" + dtFin.getDate() + "/" + dtFin.getFullYear();

                }

                PageMethods.UpdateTacheWeb(tache);

            }

        }


My problem is that the task's start and end date is well updated as I expect in the object ("tache" here) but the Gantt control is not refreshed with the new task start and end date (I mean visually).

I also checked the dataSource ($("#<%=EjGantt.ClientID%>").data("ejGantt").model.dataSource) and the task is well updated.


Did I miss something ?


Thanks, Rémi.



JR John Rajaram Syncfusion Team July 17, 2015 11:23 AM UTC

Hi Remi,

We regret for the inconvenience caused.

At present there is no support for refreshing the Gantt chart within “ActionComplete”, “TaskbarEdited” and “EndEdit” client side events after modifying the datasource. Also we have logged a feature request regarding this.

A support incident has been created under your account to track the status of this requirement. Please log on to our support website to check for further updates.

https://www.syncfusion.com/account/login?ReturnUrl=/support/directtrac/incidents

Please let us know if you require further assistance on this.
Regards,

John R



Rémi July 17, 2015 12:22 PM UTC

Hi,

Excuse me to insist, but I don't understand why I couldn't do this.
I would like to make the task to dynamically adjust his width exactly the same way the task's width is adjusted when we move the task on a holiday column.

Thanks, Rémi.


MK Mahalakshmi Karthikeyan Syncfusion Team July 20, 2015 12:32 PM UTC

Hi Remi,

Sorry about the inconvenience caused.

For your kind information the current behavior of the Gantt control is that, when we edit  a taskbar , initially the view will be refreshed with the edited values from the source and then with the new edited values the “ActionComplete” will be triggered , Since the Gantt has already been refreshed it is not possible to refresh again within “ActionComplete” event , But the changes made within the event to the datasource will be there , Currently we are not having support to refresh the Gantt Control within “ActionComplete” event, so we have logged a feature to trigger the “ActionComplete” at last after the user modification over data, then refresh the page visually. But still your requirement can be achieved by refreshing Gantt from externally like with an external custom button or with custom toolbar icon after the changes are made with datasource values.

Regards,
Mahalakshmi K.

Loader.
Live Chat Icon For mobile
Up arrow icon