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

user canceled editing - how to get this event?

when the user started editing - I showed additional columns.
after editing - I want to hide the additional columns.

3 Replies

BM Bharath Marimuthu Syncfusion Team December 13, 2016 11:52 AM UTC

Hi Razgovorov, 

Thanks for contacting Syncfusion support. 
By using “beginEdit” and “endEdit” client side events and “showColumn”,”hideColumn” public methods we can show/hide additional columns, please find the code snippet below. 
       beginEdit: beginEdit, 
       endEdit: endEdit, 
function beginEdit(args) { 
       this.showColumn("End Date"); 
  function endEdit(args) { 
       this.hideColumn("End Date"); 
We have prepared the sample for this, in this sample we have shown/hide columns on editing actions. 
Please find the sample from below mentioned location. 


RM Razgovorov Mikhail December 13, 2016 03:50 PM UTC

If you press the ESC key or cancel editing on toolbar - event did not come. and in your example too

thanks for the answer.

JS Jonesherine Stephen Syncfusion Team December 14, 2016 12:29 PM UTC

Hi Razgovorov, 
At present there is no support for any client side events while canceling the edit action in TreeGrid. But we can show/hide the particular column on toolbar cancel click action by using “toolbarClick” event. And by using the jquery keydown action we can hide the column on esc key navigation.  
Please find the code example below: 
        function toolbarclick(args) {            
            if(args.itemName=="Cancel" || args.itemName=="ExpandAll" || args.itemName=="CollapseAll") 
                this.hideColumn("End Date"); 
        $(document).keydown(function (e) { 
            //To hide the column on esc key navigation 
            if (e.keyCode === 27) {                
                var treeObj = $("#TreeGridContainer").data("ejTreeGrid"); 
                treeObj.hideColumn("End Date");               
We have also prepared the sample based on this. Please find the sample from below location 
Jone sherine P S 

Live Chat Icon For mobile
Up arrow icon