Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Sign In with Twitter Sign In with OpenID Sign In with Google

Sign In Sign Up

In this Discussion

Tagged

Welcome to the Jo support forums! Please Sign Up and join in the discussion. You can also Sign In instantly with Twitter, OpenID or your Google ID.
Help with joDOM.get()
  • droomdroom October 2010
    Posts: 5

    Hello. Can anyone pass on a tip on how to fetch DOM data with joDOM.get()?

    In my index.html, I've inserted a DIV (id="page2") right under the tag, which is supposed to be fetched and inserted in a jGroup, but it simply stays empty in my app and console gives no clue...

    thanks in advance

    droom!internet'agentur
    Jo enthusiast
  • davedave October 2010
    Posts: 415

    joDOM.get()'s job is to return a DOM node. If you pass in a string, it will attempt to find a DOM element by ID. If you pass in one of the Jo UI controls, it will return you the DOM element which that widget controls.

    If you want to associate a Jo control with a DOM element, use the setContainer() method on your Jo control, or when you create a container, you can pass it into the constructor, like this:

    var x = new joGroup(joDOM.get("page2"));
    

    If you want to create Jo controls based on an existing DOM tree, try using joInterface, which will slurp a DOM structure and create Jo JavaScript widgets from that structure on the fly.

    See the docs for more info on this feature, which may be more what you're looking for: joInterface docs.

    If that doesn't help, try posting a code sample and I'm happy to help you get it going.

    Dave Balmer, Jo Code Wrangler
  • droomdroom October 2010
    Posts: 5

    Will try that over the weekend, thanks!

    droom!internet'agentur
    Jo enthusiast