PDA

View Full Version : [FNR] [1.2.4] ComboBox scrollbars in IE



Cputerace
8 May 2009, 11:34 AM
package com.mycompany.prototype.gwtprototype.client;

import com.extjs.gxt.ui.client.data.BaseModelData;
import com.extjs.gxt.ui.client.store.ListStore;
import com.extjs.gxt.ui.client.widget.Viewport;
import com.extjs.gxt.ui.client.widget.form.ComboBox;
import com.google.gwt.core.client.EntryPoint;
import com.google.gwt.user.client.ui.RootPanel;

public class GwtPrototype implements EntryPoint {

public void onModuleLoad() {
Viewport v = new Viewport();
RootPanel.get().add(v);
ListStore<BaseModelData> ls = new ListStore<BaseModelData>();
for (int i = 0;i<3;i++)
{
BaseModelData bmd = new BaseModelData();
bmd.set("name", "abcdefghijklmnopqrstuvwxyz" + i);
ls.add(bmd);
}
ComboBox<BaseModelData> cb = new ComboBox<BaseModelData>();
cb.setDisplayField("name");
cb.setWidth("100");
cb.setStore(ls);
v.add(cb);
ComboBox<BaseModelData> cb2 = new ComboBox<BaseModelData>();
cb2.setDisplayField("name");
cb2.setWidth("200");
cb2.setStore(ls);
v.add(cb2);
}
}

Run the above code vs IE7 and vs Firefox. Notice how in IE7 it tries to add scrollbars to the top scrollbar, which breaks the calculation of the listview size, causing both scrollbars to appear.

It only happens when one of the items in a combobox is longer than the combobox, so it doesn't happen on the second combobox.

Cputerace
19 May 2009, 9:29 AM
This is still a problem. It makes our combobox look horrible. Any ETA?

romero83
8 Jun 2009, 11:57 PM
I don't tried your code, but you can try to hack it with CSS.


/* combo list items to wrap two or three rows, if not enough space available */
.x-combo-list-item{white-space:normal!important;}

And make sure if it is possible, that you don't use such string: "abcdefghijklmnopqrstuvwxyz" , because if the string does not contain "space", then it will never wrap.

z013908
18 Jun 2009, 1:58 AM
I have the same issue with combo boxes. It looks really awfull if you have a couple of items in the list and 1 of the item is longer than the list width.

See included attachment.

Standard behaviour should be that the list should adjust to the width of its largest item (like in Firefox)

Any help on this ?

The css hack does not help as there should be no word wrapping..

sven
29 Jun 2009, 6:12 AM
Fixed in SVN.

Cputerace
29 Jun 2009, 6:18 AM
I have't had a chance to check this in 2.0, is it also fixed there?

sven
29 Jun 2009, 6:31 AM
Yes