Comments (10)
Ok I did some more research. This problem is related to the fact that I add the ChosenListBox to a hidden panel. When ChosenListBox is added the setup() function is called and fWidth = $selectElement.outerWidth();
evaluates 0 because getOffsetWidth()
always returns 0 when you call it on a panel that is hidden.
It doesn't work even when I explicitly specify a width with setWidth() ChosenListBox. I am actually not sure if this is a bug or not. But it would be really helpful when I could specify an explicit width for the ChosenListBox for these use cases (where I add the ChosenListBox to a panel that is hidden).
from gwtchosen.
Hello.
I had some issues too with a zero width.
Try to use ChosenListBox.forceRedraw() just after showing your panel.
That trick fixed my issue.
from gwtchosen.
Sorry for the delay of my response : I was on holidays...
In fact the bug is on gwtquery itself http://code.google.com/p/gwtquery/issues/detail?id=145
This issue was fixed but not yet released.
As workaround, you can either call the method forceRedraw() when you reveal the hidden panel as @NicolasQuelconque said or use the last snapshot of gwtquery that includes this fix : http://code.google.com/p/gwtquery/wiki/Downloads?tm=2#Snapshot
from gwtchosen.
Great thanks for the tipp with forceRedraw(). Will use it until a new gwtquery version is released.
from gwtchosen.
I reopen the issue I find a way to fix that directly in gwtchosen
from gwtchosen.
Could you test (without using the forceRedraw() function) with the last snapshot : https://github.com/jDramaix/gwtchosen/raw/master/release/gwtchosen-1.0.3-snapshot.jar
The component should be well dimensioned even if it is hidden during the initialization.
from gwtchosen.
Thanks for the fix. Here's the feedback:
- It does work if I set the width of the control using "px" measure units, i.e. combo.setWidth("400px");
- However if I set the width using "em" (as in combo.setWidth("50em")), the combo appears with a much smaller width that I would have expected
I suspect there is another bug in that the default font used in the combo is much smaller than it should, or...?
from gwtchosen.
Could you test again with the last snapshot ? https://github.com/jDramaix/gwtchosen/raw/master/release/gwtchosen-1.0.3-snapshot.jar
from gwtchosen.
With the last snapshot, "em" units work fine, thanks!
However, another case (I'm maybe becoming annoying with those, I know):
If I set the width to percentage, like combo.setWidth("100%") it is not working.
Would it be possible to fix this as well?
We can kinda live with a fixed size, but having it resizable is also useful, especially for the case when the control is in multi-select mode and should take advantage of every available space on the screen.
from gwtchosen.
This case should be fixed when the issue http://code.google.com/p/gwtquery/issues/detail?id=145 will be fixed.
I just implement a quick and temporary fix inside GwtChosen. The only constaint is to not use percentage
And please be aware that the component fixes its size. So even when the issue will be fixed, the size of the component will not be 100% but the size in pixel of its parent. If you resize the parent after, the component will not resize automatically (you will have to call the forceRedraw() method)
from gwtchosen.
Related Issues (20)
- Missing classes into default chosen.gss
- ChosenValueListBox on change event is not fired HOT 2
- Error on demo page in custom filtering HOT 4
- Error "this.selectedItem is undefined" when add new items to ChosenListBox and update it HOT 2
- Is it possible to use gwtchosen as searchbox for multiple custom search terms? HOT 2
- X icon with multiple select chosen isn't centered
- No space in No results text HOT 1
- ChosenValueListBox allowSingleDeselect not working as expected HOT 17
- opt group dissapears on mobile gwtchosen view when select/deselecting its options HOT 2
- Make sure that box-sizing is set to content-box HOT 1
- Groups are not displayed when using a custom ResultFilter
- Using a custom ProvidesKey will cause an error in MultiChosenValueBox
- ShowingDropDownEvent missfired in iPad HOT 2
- ChosenChangeEvent fired only on selection (not deselection) HOT 1
- ChosenListBox.wrap() leads to NPE
- gwtchosen select box closes when clicking scrollbar (using IE) HOT 1
- Chosen List Box Width problems (too narrow)
- Custom Results Filter Resets Selected Options
- Failed to upgrade from GWT 2.7.0 to 2.8.0 HOT 2
- Chosen not Filtering Correctly and Error When Using Down Arrow Key to Select Results
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gwtchosen.