PDA

View Full Version : (Solved) ComboBox and Grid (wrap text)



giehl
8 Jun 2011, 6:07 AM
Help me please to solve my problem.

1. How to make combobox show all data even if that lenght is not enough (wrap text)?
2. How to make column in grid show like wrap text?

For number (1&2)
Before :
http://imageshack.us/photo/my-images/98/warp2.png/http://imageshack.us/photo/my-images/339/warp1.png/http://img339.imageshack.us/img339/5135/warp1.png

After :
http://img98.imageshack.us/img98/5870/warp2.png

Sorry for my english, thanks :)

skirtle
10 Jun 2011, 2:57 AM
Should just be CSS.

Combobox:


new Ext.form.ComboBox({
listClass: 'custom-combo',
...
});


.custom-combo .x-combo-list-item {
white-space: normal;
}

Grid:


new Ext.grid.GridPanel({
cls: 'custom-grid',
...
});


.custom-grid .x-grid3-cell-inner {
white-space: normal;
}

giehl
12 Jun 2011, 2:56 AM
can I do that with other types of grid, like dynamicgrid?

BTW thanks, bro.....

skirtle
12 Jun 2011, 3:18 AM
I don't know but I'd expect so. All I did was pull up the Chrome Developer Tools (Firebug would also do) and then inspect the elements till I found the one with white-space: nowrap on it. If you're lucky (like in the two cases above) it'll just be a case of switching it to normal.

giehl
12 Jun 2011, 3:35 AM
What css name should I change?

Answer is : ext-all.css

Success with DynamicGrid

thanks, Squirtle XD

willigogs
13 Jun 2011, 5:39 AM
I achieved this with the following:

new Ext.form.ComboBox({
listWidth: 'auto',
...
});
...although this doesn't make the text wrap. This makes the combo options all have the length of the longest entry. An alternative at least :)