[CLOSED] auto fit column(s)

  1. #1

    [CLOSED] auto fit column(s)

    Hi, My grid is displayed with column width based on user configurations. Now user wants to change col width by clicking on header options : "Fit" and "Fit All". Fit -- auto fit selected column; Fit All -- auto fit all columns. Any way to handle these requirments?
    Thanks
    -szhang
    Last edited by fabricio.murta; Aug 28, 2017 at 8:22 PM.
  2. #2
    Hello @susanz!

    This is pretty feasible, but I believe you'd need to disable buffered grid with BufferedRenderer="false" as this can lead long grids to report the wrong width.

    AutoFit (AutoSize) for the grid columns is already supported via the column header's autoSize() method. You can trigger this by double clicking the column by the resize handler (double clicking between two columns' titles).

    If you need to do this on the whole grid you can just:

    App.GridPanel1.columns.forEach(function(col) { col.autoSize(); });
    Then maybe the most work you'll have to do would be customizing the menu entry in the grid header to add the custom menu entries you want.

    I hope this helps!
    Fabrício Murta
    Developer & Support Expert
  3. #3
    Great! That works for me. Thanks for your helps!
    -szhang
  4. #4
    Glad it helps, Susan Zhang! Thanks for letting us know!

    We will mark the thread as closed then. Let us know if there's something else to it.
    Fabrício Murta
    Developer & Support Expert

Similar Threads

  1. Auto Expand Column 2.2
    By gbalista in forum 2.x Help
    Replies: 2
    Last Post: May 23, 2013, 2:09 PM
  2. [CLOSED] Grid column auto size
    By SymSure in forum 1.x Legacy Premium Help
    Replies: 1
    Last Post: Sep 28, 2011, 7:30 PM
  3. [CLOSED] how to set rownumber column auto width
    By lonely7345 in forum 1.x Legacy Premium Help
    Replies: 1
    Last Post: May 02, 2011, 3:50 PM
  4. Help Needed with auto expand column
    By pooja in forum 1.x Help
    Replies: 2
    Last Post: Nov 25, 2010, 8:26 AM
  5. Column Layout auto width problem in IE
    By sz_146 in forum 1.x Help
    Replies: 0
    Last Post: Jan 05, 2009, 10:59 AM

Posting Permissions