Sorry, I was being lazy and hoping for a quick reply as I did try a few
methods and they didn''t work..
I''ll do some more research tonight but likely just go for a dom
traversal
approach.
The div is actually a row, and contains a single input box with some links
on the far right hand side (to remove).
There is a containing div (rows) and a footer row which I think is actually
inside the rows container...
The HTML should make the structure clearer.
The idea was that if you hit tab when the final input field has focus, that
it will perform an ''add new'' as a shortcut to hitting the add
button/link
with your mouse that is below the div.
I realy shouldn''t have implemented ''columns'' with
divs, but it seemed like a
good idea at the time!
Tables I guess are really a logical choice, for.. well tabular data.
mm onclick is bad too...
<div id="Rows">
<div class="SortableItem-Alternate-EditInLine
RootSortableItem">
<div class="SortableItem-Column"
style="width:500px;">
<input type="text" style="width:480px;"
id="148" size="40"
onchange="EditValue(this.id,this.value);" value="04
Display"/>
</div>
<div class="SortableItem-Actions">
<a href="#" onclick="DeleteDropDownValue(148);
return
false;">Delete</a>
</div>
</div>
<div class="SortableItem-EditInLine RootSortableItem">
<div class="SortableItem-Column"
style="width:500px;">
<input type="text" style="width:480px;"
id="147"
onchange="EditValue(this.id,this.value);" value="05
Trival"/>
</div>
<div class="SortableItem-Actions">
<a href="#" onclick="DeleteDropDownValue(147);
return
false;">Delete</a>
</div>
</div>
<div class="SortableItem-Footer"
id="SortableItem-Footer">
<a onclick="AddValue(35); return false;"
href="#">Add</a>
</div>
</div>
I did mean :nth-child(even) rather than :even.. it was a bit of a haphazard
thought.
From the prototypejs.org api docs, it reads:
All the :nth, :first, and :last pseudo-classes. Examples include
tr:nth-child(even) (all even table rows), li:first-child (the first item in
any list), or p:nth-last-of-type(3) (the third-to-last paragraph on the
page).
This is what I was meaning by :first and :last, though I typed them with
capital letters.
Gareth
On 6/12/07, Christophe Porteneuve
<tdd-x+CfDp/qHev2eFz/2MeuCQ@public.gmane.org>
wrote:>
>
> Hey,
>
> Gareth Evans a écrit :
> > Sorry, I can''t be bothered digging through the CSS spec...
how do I
>
> I love it... And we can? Groups shouldn''t be an excuse for not
trying
> to learn for real.
>
> > write a selector to find the first immediate decendent input in the
last
> > div with a particular class.
>
> If your spec is as non-bounded as it sounds, you don''t. Are the
<input>
> elements the only children of the <div>? Is this <div>
guaranteed to be
> the last child of its parent? If both these are met, you could do:
>
> $$(''.class div:last-child >
input:first-child'').reduce()
>
> If any is not met, you''ll need to mix $$ and DOM traversal, or use
DOM
> traversall all the way...
>
> > Div.SortableItem-Column:Last > Input:First
>
> ''Last'' and ''First'' are not CSS3
selectors.
>
> > Div.SortableItem-Column > Input:Last
> >
> > Returned me the first input in the page.
>
> It shouldn''t. It asks for the last input *child* of
sortable-column
> divs (I find it odd that columns are implemented by <div>, but
that''s
> another story).
>
> > Also, the :even psuedo, does that work on non tr elements? say I had a
>
> There''s no :even pseudo, there''s :nth-child(even) though.
>
> --
> Christophe Porteneuve a.k.a. TDD
> "[They] did not know it was impossible, so they did it." --Mark
Twain
> Email: tdd-x+CfDp/qHev2eFz/2MeuCQ@public.gmane.org
>
> >
>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Spinoffs" group.
To post to this group, send email to
rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-spinoffs?hl=en
-~----------~----~----~----~------~----~------~--~---