rowIndex is a DOM property, so you'd have to use alert(trow
[0].rowIndex);
On Feb 10, 10:19 am, pantagruel wrote:
> > rowsBefore = row.rowIndex;
>
> Ok, but jQuery("#activator" + input).parent().parent(); selects the
> row, but when I try to get rowIndex of that selected row I get
> undefined b
Try:
alert( trow.get(0).rowIndex );
On Feb 10, 8:19 am, pantagruel wrote:
> > rowsBefore = row.rowIndex;
>
> Ok, but jQuery("#activator" + input).parent().parent(); selects the
> row, but when I try to get rowIndex of that selected row I get
> undefined back.
>
> var trow = jQuery("#activator"
>
> rowsBefore = row.rowIndex;
Ok, but jQuery("#activator" + input).parent().parent(); selects the
row, but when I try to get rowIndex of that selected row I get
undefined back.
var trow = jQuery("#activator" + input).parent().parent();
alert(trow.attr("class")); // the class of my row
alert(
Great discussion. Thanks for all.
-- Nivash Ramachandran
On Mon, Feb 9, 2009 at 7:19 PM, Karl Swedberg wrote:
> Oh yeah! Good point, Rob. I always forget these DOM properties. Thanks for
> the reminder. :)
>
> --Karl
>
>
> Karl Swedberg
> www.englishrules.com
> www.learningjquery.co
Oh yeah! Good point, Rob. I always forget these DOM properties. Thanks
for the reminder. :)
--Karl
Karl Swedberg
www.englishrules.com
www.learningjquery.com
On Feb 9, 2009, at 2:37 AM, RobG wrote:
On Feb 9, 4:23 am, pantagruel wrote:
Hi,
I am selecting the row of a tab
On Feb 9, 4:23 am, pantagruel wrote:
> Hi,
>
> I am selecting the row of a table. I would like to be able to count
> how many rows there are in the table before the row I just selected. i
> suppose there is a jQuery selector that will do this.
Not necessary - table rows have a rowIndex propert
Oops. Sorry, I didn't see Ricardo's reply before posting. In any case,
there's no need to filter the .prevAll() with 'tr', since no other
element is allowed as a sibling of a tr.
--Karl
Karl Swedberg
www.englishrules.com
www.learningjquery.com
On Feb 8, 2009, at 6:06 PM, Kar
You could use prevAll()
$('#myrow').prevAll().length;
--Karl
Karl Swedberg
www.englishrules.com
www.learningjquery.com
On Feb 8, 2009, at 2:30 PM, James wrote:
I did a search but I could only find a selector that selected "after"
something:
http://docs.jquery.com/Selectors/s
you should be looking at http://docs.jquery.com/Traversing
var currentRow = $('table tr').eq(7);
var howManyBefore = currentRow.prevAll('tr').length;
cheers,
- ricardo
On Feb 8, 3:23 pm, pantagruel wrote:
> Hi,
>
> I am selecting the row of a table. I would like to be able to count
> how many
I did a search but I could only find a selector that selected "after"
something:
http://docs.jquery.com/Selectors/siblings#prevsiblings
can help.
Maybe you can get the total rows count, subtract from the count from
prev ~ siblings (and probably subtract 1 also).
I hope that helps somewhat.
On Fe
Oops, I misread. You wanted the count "before" the one you selected.
Please disregard my response!
On Feb 8, 9:22 am, James wrote:
> Assuming "row" means the number of ,
> and your tables looks like:
>
> data
> data
> data
> data
> data
>
>
> you can do something like
Assuming "row" means the number of ,
and your tables looks like:
data
data
data
data
data
you can do something like:
var count = $("table tr").length;
http://docs.jquery.com/Core/length
On Feb 8, 8:23 am, pantagruel wrote:
> Hi,
>
> I am selecting the row of a table
12 matches
Mail list logo