On Mar 8, 9:00 am, mtraptor4 <[EMAIL PROTECTED]> wrote:
> I was restructing my javascript to be more object oriented. In one
> section of my code I had a loop that went through list and called
> method on each.
> $('table').childElements().each(
> function(row){
Doesn't the childElements function return the immediate descendants of
a node? The immediate descendants of a table element are (possibly)
text nodes and (certainly) table section elements.
If you want the rows of a table, then:
$('table').rows
Since you want to use .each, then perhaps:
$A($('table').rows).each(...)
Or maybe you can use $$(...).
> if(this.isSelected(row)){
> count++;
> }
> }
>
> It will not allow me to call the method inside of my object since its
Call what method? You passed a reference to an anonymous function to
each. Because of the way you have created the function, it is not
available to be called as a method (i.e. property that references a
function) of any other object.
You could change that.
> is an anonymous block.
Function.
--
Rob
--~--~---------~--~----~------------~-------~--~----~
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 [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/rubyonrails-spinoffs?hl=en
-~----------~----~----~----~------~----~------~--~---