Announcement

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

    Question about autoFit behavior in grids during editing

    SmartClient Version: v13.1p_2025-07-24/AllModules Development Only (built 2025-07-24)

    Hi, I have a question about autoFit in grids. Using the test case below, I noticed that when I edit a record, the auto-fit width seems to consider the space needed for editing, at least for the date field:

    Click image for larger version

Name:	2025-07-25 10.43.53.jpg
Views:	31
Size:	18.6 KB
ID:	276105


    If this behavior is actually intended, it's pretty cool. Is it configurable by any chance?

    Also, I see that there isn't a similar behavior for selectItem or numeric values:


    Click image for larger version

Name:	2025-07-25 10.44.00.jpg
Views:	20
Size:	20.9 KB
ID:	276106

    While I must say that for the selectItem this is not really a problem, I was thinking that maybe adding a little extra space, to account for the padding in the textBox, could make editing more comfortable. What do you think?

    Code:
    isc.ListGrid.create({
        ID: "countryList",
        width:550, height:224,
        dataSource: countryDS,
        fields:[
            {autoFit:"both", name:"countryCode", title:"Flag", width:40, type:"image", imageURLPrefix:"flags/24/", imageURLSuffix:".png", canEdit:false},
            {autoFit:"both", name:"countryName"},
            {autoFit:"both", name:"continent"},
            {autoFit:"both", name:"member_g8"},
            {autoFit:"both", name:"population",
                validators:[
                    {type:"integerRange", min:1}
                ]
            },
            {autoFit:"both", name:"independence"}
        ],
        autoFetchData: true,
        canEdit: true,
        editEvent: "click"
    })

    #2
    Although it's an interesting feature idea, no, autofitting does not currently take into account the width of the editor.

    In your sample code, the reason the "independence" field is wider than necessary to show the date values is because you set autoFit:"both", which means take the larger of the data width and the title width. The title is "Independence" so that makes the field wider.

    Comment


      #3
      Originally posted by Isomorphic View Post
      Although it's an interesting feature idea, no, autofitting does not currently take into account the width of the editor.

      In your sample code, the reason the "independence" field is wider than necessary to show the date values is because you set autoFit:"both", which means take the larger of the data width and the title width. The title is "Independence" so that makes the field wider.
      Hi, actually if you try the exact same code but with canEdit:false, you'll see that the field remains narrower, as if it takes the date chooser icon into account.

      Comment

      Working...
      X