Code Monkey home page Code Monkey logo

Comments (10)

timeu avatar timeu commented on September 26, 2024

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.

Nicolas-Nekoko avatar Nicolas-Nekoko commented on September 26, 2024

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.

jDramaix avatar jDramaix commented on September 26, 2024

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.

timeu avatar timeu commented on September 26, 2024

Great thanks for the tipp with forceRedraw(). Will use it until a new gwtquery version is released.

from gwtchosen.

jDramaix avatar jDramaix commented on September 26, 2024

I reopen the issue I find a way to fix that directly in gwtchosen

from gwtchosen.

jDramaix avatar jDramaix commented on September 26, 2024

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.

ivmarkov avatar ivmarkov commented on September 26, 2024

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.

jDramaix avatar jDramaix commented on September 26, 2024

Could you test again with the last snapshot ? https://github.com/jDramaix/gwtchosen/raw/master/release/gwtchosen-1.0.3-snapshot.jar

from gwtchosen.

ivmarkov avatar ivmarkov commented on September 26, 2024

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.

jDramaix avatar jDramaix commented on September 26, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.