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.
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.