Results 1 to 5 of 5

Thread: Auto width for Grid Columns

  1. #1
    Sencha User
    Join Date
    Aug 2016
    Posts
    14

    Default Auto width for Grid Columns

    Hi,

    In Extjs, do we have function/Config to auto adjust the column width of the grid automatically , depending on the column data.

  2. #2
    Sencha User
    Join Date
    Mar 2007
    Location
    Bédoin/Nottingham
    Posts
    30,890
    Answers
    41

    Default

    Classic has a method on Column.

  3. #3
    Sencha User
    Join Date
    Mar 2016
    Posts
    44
    Answers
    2

    Default

    just set for each column
    Code:
    flex:1

  4. #4

    Default

    flex would just set the same witdh for all of them. He wants an auto-width for each column.

  5. #5
    Sencha User
    Join Date
    Jun 2018
    Posts
    1

    Default

    Column has a method called autoSize, you can call it when the grid tableview refresh.
    like this :
    {
    xtype:'grid',
    ....balabala,
    viewConfig:{
    listeners:{
    refresh:function(d){Ext.each(d.panel.columns,function(col){col.autoSize()})}
    }
    }
    }

Similar Threads

  1. Auto adjusting width of Grid columns based on content
    By Jeff Liotta in forum Sencha Ext JS Q&A
    Replies: 1
    Last Post: 5 Apr 2012, 10:49 AM
  2. Auto Sizing WIdth of Grid Columns
    By Franz-Josef Elmer in forum Sencha GXT Q&A
    Replies: 1
    Last Post: 6 Dec 2010, 2:54 AM
  3. Replies: 1
    Last Post: 5 Oct 2009, 1:39 AM
  4. Setting Grid Columns' width as auto
    By manusis in forum Ext 2.x: Help & Discussion
    Replies: 10
    Last Post: 9 Jul 2009, 11:40 AM
  5. Auto width columns
    By in forum Ext 1.x: Help & Discussion
    Replies: 13
    Last Post: 6 Nov 2006, 5:22 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •