PDA

View Full Version : Auto-expand GridPanel cells to display all content



paulharv
23 Jun 2015, 3:50 AM
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?

Thanks

tristan.lee
23 Jun 2015, 10:12 AM
In 4.2, there was a method introduced that would handle this, but I don't believe anything is available in 3. You may need to implement that yourself.

aw1zard2
24 Jun 2015, 1:21 PM
https://www.sencha.com/forum/showthread.php?105136-Grid-Column-Width-Calculator&p=492610&viewfull=1#post492610

(https://www.sencha.com/forum/showthread.php?105136-Grid-Column-Width-Calculator&p=492610&viewfull=1#post492610)Check this thread for what your looking for.

For the height really you just need a css rule.

http://www.w3schools.com/cssref/tryit.asp?filename=trycss3_text-overflow_hover

http://www.w3schools.com/cssref/pr_text_white-space.asp (http://www.w3schools.com/cssref/tryit.asp?filename=trycss3_text-overflow_hover)

Snippet of css from grid.css in Ext JS 3.4.0 resources.


.x-grid3-cell-inner, .x-grid3-hd-inner{
overflow:hidden;
-o-text-overflow: ellipsis;
text-overflow: ellipsis;
padding:3px 3px 3px 5px;
white-space: nowrap;
}