Show/hide columns events

Hi,

I would like to cought event, when user in Context menu of TreeGrid select to hide or show Column in Gantt:
So for example if person on upper image in context menu click End date, than would End date column hide, but I could not find event where that happened. So I wonder if there is possibility to subscribe to that event, so i can save that there was column shown or hide?

I also wonder if there is any event, which I could cought when splitterPosition in Gantt is changed and on which value?

Regards,
Marko

7 Replies

PE Punniyamoorthi Elangovan Syncfusion Team July 18, 2018 01:07 PM UTC

  
Hi Marko, 
 
Thank you for contacting Syncfusion support 
 
Please find the below update 
 
Query1: If person on upper image in context menu click End date, than would End date column hide, but I could not find event where that happened. So I wonder if there is possibility to subscribe to that event, so i can save that there was column shown or hide? 
 
Answer: In TreeGrid currently there is no client side event available for hide/show the column using column menu. Can you please explain your requirement with more details and also the importance of this support in your application. It will be helpful for us to consider this feature and prioritize in our upcoming volume release.    
 
Query2: if there is any event, which I could cought when splitterPosition in Gantt is changed and on which value? 
 
Answer: Currently there is no client side event available for splitter resize action in Gantt, but we have already implemented this feature and this feature will be available in our upcoming 2018 Volume 2 Service pack 1 release, which is expected to be roll out in the end of July 2018. By using this event we can get the current and previous splitter position values in Gantt. 
 
Please let us know if you require further assistance on this. 
 
Regards, 
Punniyamoorthi 
 



MA Marko July 18, 2018 09:30 PM UTC

Hi,

thank you for your answers.
I want to save to local storage which collumns are hidden and which are not. I also want to save spliterPosition to it. So the best practise would probably be to cought events when resizing and when showing or hidding columns.
If that is not possible yet, than I will probably make click event listener on context menu and on click customly detect what happened.

Regards,
Marko


PE Punniyamoorthi Elangovan Syncfusion Team July 19, 2018 02:16 PM UTC

Hi Marko, 
As per your requirement, we have bound click event for column chooser menu and get the information about the column visibility while clicking on column chooser menu. 
Please refer the below code snippet. 
<script type="text/javascript"> 
        $(function () { 
            $("#GanttContainer").ejGantt({ 
               //.. 
           }); 
        }); 
$(document).on('click', '.e-columnMenuListDiv', function (e) { 
            if ($(e.target).hasClass("e-chkbox-small") || $(e.target).closest(".e-chkbox-small").length > 0) { 
                var taskName = $(e.currentTarget).find("label").text() 
                if ($(e.target).hasClass("e-checkmark")) { 
                    alert(taskName + " column is shown in TreeGrid") // In visible state 
                } 
                else { 
                    alert(taskName + " column is hidden in TreeGrid") // In hidden state 
                } 
            } 
            else if (!$(e.target).hasClass("e-columnMenuListDiv") && e.target.innerHTML && !$(e.target).hasClass("e-chkbox-small")) { 
                var status = $(e.target.parentElement).find(".e-checkbox").attr("checked"); 
                if (status == "checked") { 
                    var statuscolumn = "hidden"; //In hidden state  
                } 
                else 
                    statuscolumn = "Shown"; //In visible state 
                alert(e.target.innerHTML + " column is " + statuscolumn + " in TreeGrid") 
 
            } 
        }); 
</script> 
We have prepared the sample for your reference, please find the sample link below 
Currently we can’t get the splitter position in workaround on resize action, but we have provided event support for splitter resize action, using this event we get previous and current position of splitter. 
This implementation will be available in our upcoming 2018 Volume 2 Service pack 1 release, which is available at end of July 2018. 
Please let us know if you require further assistance on this. 
 
Regards, 
Punniyamoorthi 




MA Marko July 21, 2018 12:53 PM UTC

Hi,

thank you for your response and for provided example.
The given example will be a great help in developing of the desired reqirement.

Regards,
Marko


BM Bharath Marimuthu Syncfusion Team July 23, 2018 12:42 PM UTC

Hi Marko, 
We are glad to know that your requirement can be achieved with the solution we have provided. 
Please let us know if you require further assistance on this. 
Regards, 
Bharath. 



MA Marko August 12, 2018 08:37 PM UTC

Hi,

I was checking your update documentation and I could not found client side event available for splitter resize action in Gantt, so I wonder was this already implemented in 16.2.46, or it will be on any further release?

Regards,
Marko


JR John Rajaram Syncfusion Team August 13, 2018 12:59 PM UTC

Hi Marko, 
Sorry for the inconvenience caused.  
We would like to let you know that, we have published the documentation today only for the “splitterResized” event of Gantt. Please find the refreshed online documentation link below. 
In Gantt control the splitterResized event will be triggered after resizing the splitter in Gantt. 
We have prepared JS Playground sample for your reference, please find the sample link below 
Please let us know if you require further assistance on this. 
Regards, 
John R 


Loader.
Up arrow icon