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. (Last updated on : Nov 16th 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Reordering of gantt columns

Thread ID:

Created:

Updated:

Platform:

Replies:

120759 Oct 12,2015 06:37 PM UTC Oct 15,2015 10:10 AM UTC ASP.NET Web Forms 3
loading
Tags: Gantt
Dwayne Boykin
Asked On October 12, 2015 06:37 PM UTC

We would like to reorder the column in the Gantt.
The image loaded  with this thread is how we would like to have the columns ordered.
Please let us know if we are able to do this.
Thanks


Attachment: Activity_Screen_Layout_20151007_(2)_83e1131b.zip

Mahalakshmi Karthikeyan [Syncfusion]
Replied On October 13, 2015 12:50 PM UTC

Hi Dwayne,

We can re order the columns at load time using “Load” client side event. Please refer the below code example for details.

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

//…

Load="load" >

<script type="text/javascript">

            function load(args) {

                var columns = this.getColumns();

                var column = columns[7];

                columns.splice(7, 1);

                columns.splice(4, 0, column);

            }

    </script>

Here we have reordered the “Predecessor” column from 7th position to 4th position.

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/directtrac/general/ze/ColumnReorder173622835

Is this your requirement? Or else please get back to us you if want to re order the columns at run time.

Regards,

Mahalakshmi K.


Dwayne Boykin
Replied On October 14, 2015 12:03 PM UTC

We followed your example and although it moved it also created a duplicate column.
This is not desired. please assist.
I have attach code and a screen shot.

Attachment: ActGantt_8eb3212.zip

Mahalakshmi Karthikeyan [Syncfusion]
Replied On October 15, 2015 10:10 AM UTC

Hi Dwayne,

We have analyzed the code you have provided and came to know that you have removed the column and insert in the same column index. Which doesn’t affect any column re order in any case. First we must take the column data and remove the column from the column collection, then again we have to insert the same column data to the desired column index. We have achieved the column re order using this and please find the code example below for more details.

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

//…

Load="load" >

<script type="text/javascript">

            function load(args) {

                var columns = this.getColumns();


                //Duration column

                var column = columns[5];

                columns.splice(5, 1);

                columns.splice(4, 0, column);


                //Predecessor column

                var column = columns[7];

                columns.splice(7, 1);

                columns.splice(5, 0, column);

            }

    </script>

We have attached the screenshot of this requirement and please find the image from the following location.

File location: http://www.syncfusion.com/downloads/support/directtrac/general/ze/GanttColumn-1518397122

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/directtrac/general/ze/ColumnOrder-1035699925

Regards,

Mahalakshmi K.


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.

Warning Icon 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.Close Icon

;