ExtJS EditorGridPanel ~ set row height and cell width to display all cell content

1.1k views Asked by At

When cells in an ExtJS GridPanel or EditorGridPanel contain more data than they can display, users have to resize columns.

Is there a way to have the GridPanel automatically expand the width and height of its columns/rows to display its data? Are there any examples out there of doing this?

Using ExtJS 3.4

Thanks

1

There are 1 answers

0
José Antonio Sánchez Sánchez On

The autofit isn´t implemented until version 4.0.2, but you can use with and minWidth properties.

http://docs.sencha.com/extjs/4.2.0/#!/api/Ext.grid.column.Column-method-autoSize

columns: [
    { text: 'data1', dataIndex: 'name',  width: 150, autoSizeColumn: true },
    { text: 'data2', dataIndex: 'email', width: 100, autoSizeColumn: true, minWidth: 150 },
    { text: 'Phone', dataIndex: 'phone', width: 50 }
]