Checkbox TreeView availability ?

Discussion in 'Ruby' started by mike courtney, Jul 13, 2006.

  1. Does anyone know of a RoR implementation of a TreeView in which you can
    navigate to leafs of branches and select multiple leafs of interest via
    checkboxes. An example of this is the javascript Checkbox Tree available
    at http://www.treeview.net/treemenu/3fr_checkbox.html. It is also nice
    to be able to open all or close all branches via a button, and to select
    all leafs or unselect all of them.

    I would rather not have to build this from scratch as I have plenty of
    other RoR work that I want to do. Thanks for any solid leads on this
    subject.

    Regards,
    Mike

    --
    Posted via http://www.ruby-forum.com/.
     
    mike courtney, Jul 13, 2006
    #1
    1. Advertisements

  2. mike courtney, Jul 15, 2006
    #2
    1. Advertisements

  3. mike courtney

    Jim Morris Guest

    I added the entry to my blog, it looks like this...

    This is done with a little bit of javascript.

    The view code looks like...


    <a href="#" onclick="checkAll('permissions_<%= controller_id %>[]'); return false;"\>all&lt;/a>
    <a href="#" onclick="uncheckAll('permissions_<%= controller_id %>[]'); return false;"\>none&lt;/a>

    The java script is...

    function checkAll(name)
    {
    boxes = document.getElementsByName(name)
    for (i = 0; i < boxes.length; i++)
    boxes.checked = true ;
    }

    function uncheckAll(name)
    {
    boxes = document.getElementsByName(name)
    for (i = 0; i < boxes.length; i++)
    boxes.checked = false ;
    }


    mike courtney wrote:
    > Jim Morris wrote:
    >> I did something like this, which I describe in this blog entry.
    >>
    >> http://blog.wolfman.com/articles/2006/05/20/role-based-authentication-admin-page
    >>
    >> It is simple, and I have seen the set all and clear all implemented in
    >> java script,
    >> I'll try to dig that up and add it to the blog.

    >
    > Thank you for the information Jim. Pls let me know if/when you add it to
    > the blog.
    >
    > Cheers.
    >


    --
    Jim Morris, http://blog.wolfman.com
     
    Jim Morris, Jul 17, 2006
    #3
    1. Advertisements

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. tshad
    Replies:
    0
    Views:
    744
    tshad
    Apr 15, 2005
  2. Vikram

    disable checkbox list checkbox

    Vikram, Jan 25, 2006, in forum: ASP .Net
    Replies:
    1
    Views:
    1,574
    ThunderMusic
    Jan 25, 2006
  3. =?Utf-8?B?RG90TmV0RGV2?=

    DataGrid and embeded Checkbox..How to find if checkbox clicked

    =?Utf-8?B?RG90TmV0RGV2?=, Oct 6, 2006, in forum: ASP .Net
    Replies:
    1
    Views:
    1,027
    David Wier
    Oct 6, 2006
  4. Jason Huang
    Replies:
    0
    Views:
    709
    Jason Huang
    Jun 29, 2007
  5. Joey Pang
    Replies:
    4
    Views:
    853
    Joey Pang
    Jun 13, 2005
  6. Imran Aziz

    checkbox value attribute in checkbox control ?

    Imran Aziz, Aug 6, 2005, in forum: ASP .Net Web Controls
    Replies:
    2
    Views:
    357
    Imran Aziz
    Aug 8, 2005
  7. Michael Champagne
    Replies:
    4
    Views:
    620
    Matt Kruse
    Apr 20, 2004
  8. Terje
    Replies:
    5
    Views:
    583
    Evertjan.
    Nov 18, 2004
Loading...