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

Getting customized display

Hello everyone,,
I would like to know if it is possible to get the display settings after a user change columns visibility, order or columns width?

With the columnDrop method, I can have the moved column but not its order in the column list. I also tried the getColumns method but the order is from the first generation of the grid and doesn't take the changed order by the user.

I need to save these custom settings so I need to retrieve all data that users modify (visibility, order, and width).

Is there a way to do that?

Regards.

4 Replies

IS Indrajith Srinivasan Syncfusion Team January 6, 2020 11:26 AM UTC

Hi Humanjo,  
  
Currently, we are validating the reported query and update further details on 7th January. 

Regards,
  
Indrajith 



BS Balaji Sekar Syncfusion Team January 7, 2020 12:07 PM UTC

Hi Humanjo, 
 
Thanks for your patience. 
 
Yes. it is possible to get the display settings after a user change columns visibility, order or columns width. You can get the details in ActionComplete and ResizeStop events of the Grid. Please find the below code example and sample for more information. 
 
Index.ts 

 let data: Object = orderData.slice(015); 
    let grid: Grid = new Grid( 
        { 
            dataSource: data, 
            showColumnChooser: true, 
            toolbar: ['ColumnChooser'], 
            allowReordering: true, 
            allowResizing: true, 
            actionComplete: (args)=>{ 
            if (args.requestType === 'columnstate') { 
             console.log('Column Visiblity changed',args); 
              } 
            if (args.requestType === 'reorder') { 
             console.log('Column Order changed',grid.getColumns(), args); 
              } 
            }, 
            resizeStop : (e)=> { 
              console.log(e.column.field + ' column width changed to ' + e.column.width ); 
            }, 
. . . 
        }); 
    grid.appendTo('#Grid'); 

 
 
Regards, 
Balaji Sekar. 



HD Humanjo Daro January 7, 2020 10:56 PM UTC

Hello everyone,,
I would like to know if it is possible to get the display settings after a user change columns visibility, order or columns width?
With the columnDrop method, I can have the moved column but not its order in the column list. I also tried the getColumns method but the order is from the first generation of the grid and doesn't take the changed order by the user.
I need to save these custom settings so I need to retrieve all data that users modify (visibility, order, and width).
Is there a way to do that?

Regards.

Thank you my issue has been solved,...


DR Dhivya Rajendran Syncfusion Team January 8, 2020 05:55 AM UTC

Hi Humanjo, 
 
We are happy to hear that the provided solution was helpful to resolve the problem. Please get back to us if you need further assistance from us. 
 
Regards, 
R.Dhivya  


Loader.
Live Chat Icon For mobile
Up arrow icon