[jQuery] Re: Anything similar to IE's table.moveRow in jquery?

2007-08-02 Thread Klaus Hartl
Wizzud wrote: $('table') ... gets all tables $('table').eq(1) ... gets the second table $('#formelement').parent().parent().parent() ... gets the 'great-grandad' of #formelement or, to look back up the DOM for a table ... var _find = $('#formelement'); while(!_find.is('table')){ _find =

[jQuery] Re: Anything similar to IE's table.moveRow in jquery?

2007-08-02 Thread Wizzud
$('table') ... gets all tables $('table').eq(1) ... gets the second table $('#formelement').parent().parent().parent() ... gets the 'great-grandad' of #formelement or, to look back up the DOM for a table ... var _find = $('#formelement'); while(!_find.is('table')){ _find = _find.parent(); }

[jQuery] Re: Anything similar to IE's table.moveRow in jquery?

2007-08-02 Thread Wizzud
Klaus Hartl wrote: $('#formelement').parents('table:eq(0)'); Even simpler. NOTE: In documentation of parents(), first example is misleading/incorrect in that shows the returned items in reverse order. -- View this message in context:

[jQuery] Re: Anything similar to IE's table.moveRow in jquery?

2007-08-02 Thread Sam Collett
Some simple plugins that may help. (function($) { $.fn.moveRowAfter = function(index, afterIndex) { this.find(tr).eq(index).insertAfter(this.find(tr).eq(afterIndex)); return this; }; $.fn.moveRowBefore = function(index, beforeIndex) {

[jQuery] Re: Anything similar to IE's table.moveRow in jquery?

2007-08-02 Thread Mike Miller
Sam...what plugins are you refering to with the moveRowAfter? M On Aug 2, 2:24 am, Wizzud [EMAIL PROTECTED] wrote: $('table') ... gets all tables $('table').eq(1) ... gets the second table $('#formelement').parent().parent().parent() ... gets the 'great-grandad' of #formelement or, to

[jQuery] Re: Anything similar to IE's table.moveRow in jquery?

2007-08-02 Thread Mike Miller
Ok...so this is working somewhat...the issue I see now is that the find() in the plugins are finding the wrong row. My table structure looks like this: table - row1 - cell 1 -table row 2 -cell 1 -table row3 -cell 1 -table When we use the

[jQuery] Re: Anything similar to IE's table.moveRow in jquery?

2007-08-02 Thread Klaus Hartl
Mike Miller wrote: Ok...so this is working somewhat...the issue I see now is that the find() in the plugins are finding the wrong row. My table structure looks like this: table - row1 - cell 1 -table row 2 -cell 1 -table row3 -cell 1 -table When

[jQuery] Re: Anything similar to IE's table.moveRow in jquery?

2007-08-02 Thread Klaus Hartl
Klaus Hartl wrote: Mike Miller wrote: Ok...so this is working somewhat...the issue I see now is that the find() in the plugins are finding the wrong row. My table structure looks like this: table - row1 - cell 1 -table row 2 -cell 1 -table row3 -cell 1

[jQuery] Re: Anything similar to IE's table.moveRow in jquery?

2007-08-02 Thread Mike Miller
ok Klaus, Thanks for this...it truly is amazing what jquery can do. A quick question for you though regarding the index property. If I want to make this more dynamic...do you know how I would find out the value of the rowIndex property for the table row I want to move? On Aug 2, 1:17 pm,

[jQuery] Re: Anything similar to IE's table.moveRow in jquery?

2007-08-02 Thread Klaus Hartl
Mike Miller wrote: Thanks for this...it truly is amazing what jquery can do. A quick question for you though regarding the index property. If I want to make this more dynamic...do you know how I would find out the value of the rowIndex property for the table row I want to move? Get it

[jQuery] Re: Anything similar to IE's table.moveRow in jquery?

2007-08-02 Thread Mike Miller
Here is my snippet: var myIndex = $j(#show_medication).parents(tr)... #show_medication is a form element. parents(tr) is the row containing the element Now I want to get the rowIndex Once I have the rowIndex property I would call the moveRow function as follows:

[jQuery] Re: Anything similar to IE's table.moveRow in jquery?

2007-08-02 Thread Klaus Hartl
Mike Miller wrote: Here is my snippet: var myIndex = $j(#show_medication).parents(tr)... #show_medication is a form element. parents(tr) is the row containing the element Now I want to get the rowIndex Once I have the rowIndex property I would call the moveRow function as follows:

[jQuery] Re: Anything similar to IE's table.moveRow in jquery?

2007-08-01 Thread Mike Miller
Hi, Thanks for the tip...the one other question I have related to this that I need to move these rows in a table that has no id. The table does have form elements that have id's and I could do something like this in JS document.getElementById(formelement).parentNode.parentNode.parentNode -

[jQuery] Re: Anything similar to IE's table.moveRow in jquery?

2007-07-31 Thread Dave Probert
Or for more detailed movement: $('tr:eq(3)').insertBefore('tr:eq(1)'); or $('tr:eq(2)').insertAfter('tr:eq(5)'); Note: the numbers are the row count - beginning at 0 (zero) for the first row. Lookup the jquery :xxx qualifiers for more options. On Jul 31, 4:16 am, Mike Miller [EMAIL

[jQuery] Re: Anything similar to IE's table.moveRow in jquery?

2007-07-30 Thread Klaus Hartl
Mike Miller wrote: Haven't been able to find any documentation so far that talks about how to move rows around with jquery. Don't really need to sort the whole table...rather I want to move one row to another position. Can this be done? The following should work as long as I'm not missing