How to autoFitColumns() after closing ColumnChooser ?

Hello!

I use 
     this.$refs.grid.autoFitColumns([]);
in dataBound handler in my application. It works good, but when I change number of shown columns with ColumnChooser, I need to call autoFitColumns([]) again. But I didn't find proper handler for that. Can you tell me the name of this handler, or any other way to call autoFitColumns (or, maybe, grid's refresh) after ColumnChooser changes applied to the table?




3 Replies

BS Balaji Sekar Syncfusion Team May 28, 2020 06:53 AM UTC

Hi Oleg, 

Greetings from the Syncfusion support. 

We have validated your query with provided information and we suggest you to use actionBegin event with requestType of columnstate  while column show/hide action in Grid using Columnchooser. Please refer the below code example and sample for more information. 

[App.Vue] 
  methods: { 
      actionBegin: function(args){       
      if(args.requestType === "columnstate"){ 
// Write your code here while show/hide Grid column(s) through ColumnChooser 
      } 
    }, 



Please get back to us, if you need further assistance. 

Regards, 
Balaji Sekar 



OL Oleg May 28, 2020 08:04 AM UTC

Thanks.


BS Balaji Sekar Syncfusion Team May 29, 2020 09:56 AM UTC

Hi Oleg 
  
You are welcome, Please get back to us if you require further other assistance from us. 
  
Regards, 
Balaji Sekar. 


Loader.
Up arrow icon