Hi Marcelo,
Thanks for using Syncfusion products.
Query 1:
I need to show only the columns "Task Name" and "End Date" in Tree Grid.
It´s possible to hide some columns.
Solution:
In Gantt control, we can display the "Task Name" and "End Date" columns alone at TreeGrid part using the “Load” client side event.
Please refer the below code snippets for more details.
Code snippet:
<body> <form id="form1" runat="server" <ej:Gantt ID="Gantt" runat="server" //... Load="Load"> //... </ej:Gantt> <script> function Load(args) { var columns = this.getColumns(), length = columns.length; for (var i = (length-1); i >= 0 ; i--) { if (columns[i].field == "taskId" || columns[i].field == "startDate" || columns[i].field == "status") { columns.splice(i, 1); } } } </script> </form> </body> |
We have also prepared a sample based on this. Please find the sample in the following location.
Sample: http://www.syncfusion.com/downloads/support/forum/118683/TwoColumnGantt375453174.zip
We would also like to let you know that, we have already logged and implemented the feature “Column chooser” for hiding and displaying some columns at TreeGrid part of Gantt chart dynamically.
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
Query 2:
change order of position?
ID, TaskName, End Date, Start Date, ...
Solution:
In Gantt control, we can change the order position of the TreeGrid columns. Please refer the below code snippets for positioning the “End Date” column before the “Start Date” column.
Code snippet:
<body> <form id="form1" runat="server" <ej:Gantt ID="Gantt" runat="server" //... Load="Load"> //... </ej:Gantt> <script> function Load(args) { var columns = this.getColumns(), length = columns.length; for (var i = 0; i < length; i++) { if (columns[i].field == "endDate") { var endDateColumn = columns.splice(i, 1); break; } } for (var i = 0; i < length; i++) { if (columns[i].field == "startDate") { columns.splice(i, 0, endDateColumn[0]); break; } } } </script> </form> </body> |
We have also prepared a sample based on this. Please find the sample in the following location.
Sample: http://www.syncfusion.com/downloads/support/forum/118683/ColumnOrderChange-325323468.zip
Please let us know if you require further assistance on this.
Regards,
John R
Hi Marcelo,
Thanks for the update.
Please let us know if you require further assistance on this.
Regards,
John R
Hi Marcelo,
Thanks for the update.
Please let us know if you require further assistance on this.
Regards,
John R