GithubHelp home page GithubHelp logo

Comments (6)

jDramaix avatar jDramaix commented on July 17, 2024
public interface FirstResources extends Resources {
    public FirstResources INSTANCE = GWT.create(FirstResources.class);

    public interface FirstStyle extends ChozenCss{}

    @Override
    @Source("FirstCssFile.css")
    FirstStyle css();
}

and

public interface SecondResources extends Resources {
    public SecondResources INSTANCE = GWT.create(SecondResources.class);

    public interface SecondStyle extends ChozenCss{}

    @Override
    @Source("SecondCssFile.css")
    SecondStyle css();
}

Should work ?

from gwtchosen.

Shuky avatar Shuky commented on July 17, 2024

Yeah, that's exactly what I did. When I open the first view that has a
chosen with FirstResources and then close it and open the second view with
a chosen with Second Resources - than the chosen drop down suggestions
appear on the upper right side of the screen (the chosen box is located
somewhere in the middle of the screen)

If I open the second view first, than it works perfectly....
:/
On Feb 27, 2013 12:24 AM, "Julien Dramaix" [email protected] wrote:

public interface FirstResources extends Resources {
public FirstResources INSTANCE = GWT.create(FirstResources.class);

public interface FirstStyle extends ChozenCss{}

@Override
@Source("FirstCssFile.css")
FirstStyle css();}

and

public interface SecondResources extends Resources {
public SecondResources INSTANCE = GWT.create(SecondResources.class);

public interface SecondStyle extends ChozenCss{}

@Override
@Source("SecondCssFile.css")
SecondStyle css();}

Should work ?


Reply to this email directly or view it on GitHubhttps://github.com//issues/64#issuecomment-14143764
.

from gwtchosen.

jDramaix avatar jDramaix commented on July 17, 2024

You have to also inject manually the second css (before to call chosen):

//true is important here to force the injection at the time you call the method
StyleInjector.inject(SecondResources.INSTANCE.css().getText(), true);

from gwtchosen.

Shuky avatar Shuky commented on July 17, 2024

10x, I'll give it a try.
Is there a difference between calling the line you mentioned and
SecondResources.css().ensureInjected()? (that's what I'm doing now)
On Feb 27, 2013 9:18 AM, "Julien Dramaix" [email protected] wrote:

You have to also inject manually the second css (before to call chosen):

//true is important here to force the injection at the time you call the methodStyleInjector.inject(SecondResources.INSTANCE.css().getText(), true);


Reply to this email directly or view it on GitHubhttps://github.com//issues/64#issuecomment-14160393
.

from gwtchosen.

Shuky avatar Shuky commented on July 17, 2024

Cool, yet works magically!
So why does that work and INSTANCE.css().ensureInjected(); doesn't?

שוקי.

On Wed, Feb 27, 2013 at 9:21 AM, שוקי קפון [email protected] wrote:

10x, I'll give it a try.
Is there a difference between calling the line you mentioned and
SecondResources.css().ensureInjected()? (that's what I'm doing now)
On Feb 27, 2013 9:18 AM, "Julien Dramaix" [email protected]
wrote:

You have to also inject manually the second css (before to call chosen):

//true is important here to force the injection at the time you call the methodStyleInjector.inject(SecondResources.INSTANCE.css().getText(), true);


Reply to this email directly or view it on GitHubhttps://github.com//issues/64#issuecomment-14160393
.

from gwtchosen.

jDramaix avatar jDramaix commented on July 17, 2024

SecondResources.INSTANCE.css().ensureInjected() will inject the css in the dom at the end of the loop.
StyleInjector.inject(SecondResources.INSTANCE.css().getText(), true); forces the style to be injected at the time the method is called.

Chosen needs that the style is applied before to call it, otherwise a number of dimension computation are wrong.

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.