Hi, I''m calling on those with Prototype/CSS selector foo to help with a
somewhat tricky issue.
I have a tree structure where each item is hierarchical. This is used
to manage software components. Think of the case where you''re
installing a piece of software, and want to customize which packages
are installed:
[ ] Internet
[ ] Email
[ ] Thunderbird
[ ] Evolution
[ ] Outlook Express
[ ] Browsing
[ ] Firefox
[ ] Internet Explorer
[ ] Entertainment
[ ] Music
[ ] iTunes
[ ] Winamp
In this menu, if the user clicks on a given checkbox, I want all sub
elements to check as well (and the same on uncheck, obviously).
Since there are all simple checkboxes, I tried attaching this function
to onclick:
function toggle_children (input) {
// locate "input#myid input" (all children)
$$(''input#''+input.id+''
input'').each(function (item) {
if (input.id !== item.id) {
item.checked = input.checked;
}
});
}
But unfortunately, that did not select the elements. The pure CSS
selector that should work is:
input#myid > input
However, unfortunately passing that to Prototype gives "error parsing
selector at: > "
Ideas?
Thanks,
Nate
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---