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

    Resize last field of ListGrid

    Is there a way to have the last field of a ListGrid auto-fit the size of the grid after the header is dragged to a new size? See the attached image. This is after I have drag-resized the last column header to the left. The header resizes but the records inside the grid do not, until I resize the container by even 1 pixel, then they snap to fill up the extra space.

    I've tried all the combinations of autoFitxxx that I can think of and nothing seems to work.

    I would also like the last column to shrink to fit the available space when the header is dragged to the right instead of a scroll bar appearing, but that is less important.

    Attached Files
    Last edited by gdan; 22 May 2023, 07:47.

    You can set grid.autoFitExpandField


      That is one of the first thing I tried and it isn't working for me. Is there something else that must be set?

      I tried combinations of all of these:

      autoFitFieldWidths: true
      autoFitExpandField: "value"
      autoFitFieldsFillViewport: true

      I tried those on the example here and it didn't seem to work:

      ID: "countryList",
      width:500, height:224, alternateRecordStyles:true,
      autoFitFieldWidths: true,
      autoFitExpandField: "gdp",
      {name:"countryCode", title:"Code"},
      {name:"countryName", title:"Country"},
      {name:"independence", title:"Nationhood", type:"date", width:100},
      {name:"population", title:"Population", type:"integer"},
      {name:"gdp", title:"GDP", type:"float"}
      data: countryData


        autoFitExpandField is the name of a field. You don’t have a field with name:“value“. Try it with aFEF:“gdp“.

        Best regards


          Sorry, I wasn't very clear on this. The first paste of 3 lines was from my code, where I do have a field named "value". The other code I pasted is from the example link and it has a field named "gdp". If you go to that example link and paste the code below it, you will see the issue.