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

Reordering of gantt columns

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

3 Replies

MK Mahalakshmi Karthikeyan Syncfusion Team 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.



DB Dwayne Boykin 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


MK Mahalakshmi Karthikeyan Syncfusion Team 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.


Loader.
Live Chat Icon For mobile
Up arrow icon