Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    Field autofit does not work for date / datetime types

    Hey Isomorphic

    column functionality Autofit does not work for date / datetime fields.

    e.g.: https://www.smartclient.com/smartcli...tValuesBuiltin (no changes needed, just click on column header and then click autofit all columns)

    Click image for larger version

Name:	Annotation 2019-12-18 090115.png
Views:	110
Size:	20.2 KB
ID:	260485

    #2
    When you auto-fit all columns, you are auto-fitting to data. You seem to expect auto-fitting to title, but that's not what the feature is designed to do.

    Comment


      #3
      Isomorphic there is a „19...“ in the Nationhood column in the screenshot. I assume the OP is speaking about this.

      Best regards
      Blama

      Comment


        #4
        Originally posted by Isomorphic View Post
        When you auto-fit all columns, you are auto-fitting to data. You seem to expect auto-fitting to title, but that's not what the feature is designed to do.
        No, I expect auto-fitting to formatted data values (as you can see in the screenshot where title nor data are autofitted correctly).

        For date type values there is currently no width calculation and when autofit is called a constant value of 92px is set no matter the width of the data.

        Comment


          #5
          For "date" type fields, and certain other field types, ListGrids have a built in optimization to assume a known default width for all content.
          (This allows the auto-fit logic to skip writing out the content of every cell and measuring it to determine the actual drawn size.)

          For date fields the default width is set by listGrid.defaultDateFieldWidth. If you set this property to null, it will be ignored and the content will be measured for each cell as with other field types. This is appropriate if you're applying custom formatting to your date field (as in this sample).

          Regards
          Isomorphic Software


          Comment

          Working...
          X