dboi517

How to set column widths of datagrid/attribute table with typicalItem or explicitly

Discussion created by dboi517 on Jun 7, 2013
Latest reply on Jun 10, 2013 by dboi517
Hello,

I have an application with an attribute table calling a feature service from ArcGIS Server 10.  I also have an Attribute Table skin which has removed the table options button as it was not necessary for our purposes.  The fields in the attribute table are being grabbed using an outFields property as follows:
outFields="[ADDRESS,NEIGHBORHOOD,EST_SPILL_START_DATE,EST_SPILL_END_DATE,EST_SPILL_START_TIME,EST_SPILL_END_TIME,SPILL_VOLUME_GAL,CAUSE,CORRECTIVE_ACTION]


Also, these outFields fields are the actual name, not the alias that displays on my attribute table.  So there are 9 fields that are displayed. The application itself is being embedded into a slightly small 600p x 590pixel window.  Currently, the AttributeTable width is set to 100%. The dataGrid in the skin also has a width of 100%

The most important thing for my application to do is have all the column widths be the appropriate size to fit the largest data item in that field. I understand this is done best practice by using the typicalItem property. However, I have no idea how to get it to work correctly.  If it means ditching the skin, I am okay with that--it is more important to get the column widths so that none of the headers display a "..." ellipse.  I am also ok with setting every column to the same width as long as it's long enough to fit the largest title, I believe that would be "NEIGHBORHOOD"


FYI Below is my code for the attribute table:
  <esri:AttributeTable id="myAttributeTable"
        width="100%" height="100%"
        deleteEnabled="false"
        updateEnabled="false"
        showTitle="false"
        exportLocation="false"
        featureLayer="{myFeatureLayer}"/> 


And this is my code for the dataGrid in my AttributeTableSkin:
   <s:DataGrid id="dataGrid"
      width="100%" height="100%"
      alpha.noFeatures="0.2"
      itemEditor="com.esri.ags.skins.supportClasses.AttributeTableItemEditor"
      itemRenderer="com.esri.ags.skins.supportClasses.AttributeTableItemRenderer"
      selectionMode="multipleRows"/>


To sum:  how do I set the column widths using the typicalItem property? Would it be done on the dataGrid in the skin? Or on the attribute table in my main application?

If the above is too hard/not possible, how can I explicitly set the widths of the columns?

If anyone can answer either of these questions it would be a huge help.  Thank you.

David

Outcomes