Select to view content in your preferred language

Dynamically Set Width of FeatureTable Columns

743
3
Jump to solution
06-30-2022 07:48 AM
ChristopherSchreiber
Frequent Contributor

Hello all!

 

Our team is trying to dynamically set the width of all of the columns in a FeatureTable. We would like to have each column be as long as the longest value in that column. 

By default, the FeatureTable makes all columns the same width, regardless of the side of the data they contain. 

 

Has anyone Tried to do this before?

 

Thanks!

 

Chris

0 Kudos
1 Solution

Accepted Solutions
Justin_Greco
Frequent Contributor

This works for me:

featureTable.grid?.findColumn(“FIELDNAME”)?.width = 100;

View solution in original post

0 Kudos
3 Replies
Justin_Greco
Frequent Contributor

This works for me:

featureTable.grid?.findColumn(“FIELDNAME”)?.width = 100;

0 Kudos
ChristopherSchreiber
Frequent Contributor

Thanks @JustB!

This worked!

0 Kudos
ChristopherSchreiber
Frequent Contributor

Esri also added a "width" property to the Column class in the JS SDK.

https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureTable-Grid-Column....

0 Kudos