Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.javascript > #23382

Re: Reversing the rows of a table ??

Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.datemas.de!uucp.gnuu.de!newsfeed.arcor.de!newsspool4.arcor-online.net!news.arcor.de.POSTED!not-for-mail
Content-Type text/plain; charset="ISO-8859-1"
Message-ID <2779103.sO63zRiCyQ@PointedEars.de> (permalink)
From Thomas 'PointedEars' Lahn <PointedEars@web.de>
Reply-To Thomas 'PointedEars' Lahn <cljs@PointedEars.de>
Organization PointedEars Software (PES)
Date Tue, 04 Mar 2014 12:16:09 +0100
User-Agent KNode/4.11.5
Content-Transfer-Encoding 7Bit
X-Face %i>XG-yXR'\"2P/C_aO%~;2o~?g0pPKmbOw^=NT`tprDEf++D.m7"}HW6.#=U:?2GGctkL,f89@H46O$ASoW&?s}.k+&.<b';Md8`dH6iqhT)6C^.Px|[=M@7=Ik[_w<%n1Up"LPQNu2m8|L!/3iby{-]A+#YE}Kl{Cw$\U!kD%K}\2jz"QQP6Uqr],./"?;=4v
Face iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAAGFBMVEXTxa4RFk5dUWANED8PFEfy7+MGBiW+n3ZNF/QuAAACaElEQVQ4jVXUwVOcMBQG8Dc7Rc4PUntdWV2uxjDpGaGeozOp1woar4jd5t/v9wLstMwsA/ntlxdCAgUc1hjTc9/JCZfGoo3wG3HdmdAWrIJRHe7GM/TmpY5VFefuVcAkkPbLIaN8rmPmjloyZxgyR3GuJ4K0AGtJ2htz8o7yqikm759fldQXaMpbDzjKAG+8v+AugVTOPO5DOjLvGtUYQwh0CPjnVMyGd+8/GfUB5nLKJDD2aLDh5HYyMDJGDwQIo2ZmZcKbowNmAdB/AzyFhrmF2MHRb0QJJfaAnwGB6orZhoykLzJtGwF/xpYxI1dswomiUj3gTuAIqCn/4C7cULwGNBtwMTk3Y4LfKB5YUaOKBKYtpplm7u0vip8tU1NWWyI/7XdcSuIDoMt6rVHMWT0DbjHPGqDqZVSa6zleLcUTcIKLoMv3ueJluALtAo9B302zPPlrtiVScRdCjXvVh3e3JpYa/jjkuC9N+LrBMlz/eAN4eQijX2EdLo6c5tGGHwLyHFtXk89dDGHwCVhG9T0S/j55AhRZgkMCmUQXJ49TnS1wnQDvw0eAh9ICeMmEFbCnPMFzjAvsWoEWEFdYEx+S0MoUZ1gT1wId8+AF3Bl2OoEu906AUHx5VLw/gXYg/x84loOah/2UYNrgiwSwGO7RfUzVBbx/kgpckumGOi6QirtD6gkLTitbnxNol47S2jVc2vsN5kPqaAHT8uUdAJM4v/DanjYOwmUjWznGfwB7sGtAtor5BgofDuzaRj4kSQAqDakTsKORa3Q3xKi3gE1fhl71KRMqrdZ2AWNNg/YOhQyrVBnb+i+nEg4bsDA+egAAAABJRU5ErkJggg==
Subject Re: Reversing the rows of a table ??
Newsgroups comp.lang.javascript
References <bnkj72FqrjaU1@mid.individual.net> <6ecd1d1a-8bd0-4c4f-8f38-c5d6ff8e012a@googlegroups.com> <bnkl7sFr7tdU1@mid.individual.net> <e9d2a9ad-89b7-4ade-9404-85d724dfa252@googlegroups.com>
MIME-Version 1.0
Lines 41
NNTP-Posting-Date 04 Mar 2014 12:16:12 CET
NNTP-Posting-Host 9fde76d9.newsspool2.arcor-online.net
X-Trace DXC=B8cQf:Z\Wa>^8FBo0_81f>A9EHlD;3Yc24Fo<]lROoR18kF<OcfhCO;0JSPn\CReV4DZm8W4\YJN<YUVHKH;GI^7E9g_8T=V`h6bo08l89QOl7
X-Complaints-To usenet-abuse@arcor.de
Xref csiph.com comp.lang.javascript:23382

Show key headers only | View raw


Michael Haufe (TNO) wrote:

> On Monday, March 3, 2014 6:31:53 PM UTC-6, Mel Smith wrote:
>> Michael said:
>> >
>> > You want to reverse the rows before you have all the rows?
> [...]
>>     No, after the table is completely loaded, then I wish to hide the
>>     table,
>> reverse the rows, then show the table
> 
> One approach is to create a second tbody in the table and then copy/move
> the old rows from the bottom up into the new tbody and then remove the old
> tbody when complete.
> 
> <https://developer.mozilla.org/en-US/docs/Web/API/HTMLTableElement>
> 
> Evertjan is correct though that it would be wiser to populate a different
> data structure and then reverse it there before populating the table.

That would require

  1a. Creating a native object.
  2a. Copying the table (body) data to that object.
  3a. Reversing the order of the data in the object.
  3b. nothing
  4a. Copying the data from the object to the DOM object.
  4b. Copying the data from the object to the DOM object
      in reverse order.

By contrast, you could just

  1c. Reverse the order of the nodes in the document tree in place.

Why is the former wiser?

-- 
PointedEars
FAQ: <http://PointedEars.de/faq> | SVN: <http://PointedEars.de/wsvn/>
Twitter: @PointedEars2
Please do not Cc: me. / Bitte keine Kopien per E-Mail.

Back to comp.lang.javascript | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Reversing the rows of a table ?? "Mel Smith" <med_cutout_syntel@aol.com> - 2014-03-03 16:57 -0700
  Re: Reversing the rows of a table ?? "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2014-03-04 01:15 +0100
  Re: Reversing the rows of a table ?? "Michael Haufe (TNO)" <tno@thenewobjective.com> - 2014-03-03 16:19 -0800
    Re: Reversing the rows of a table ?? "Mel Smith" <med_cutout_syntel@aol.com> - 2014-03-03 17:31 -0700
      Re: Reversing the rows of a table ?? "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2014-03-04 01:36 +0100
      Re: Reversing the rows of a table ?? "Michael Haufe (TNO)" <tno@thenewobjective.com> - 2014-03-03 18:51 -0800
        Re: Reversing the rows of a table ?? "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2014-03-04 08:57 +0100
        Re: Reversing the rows of a table ?? Hans-Georg Michna <hans-georgNoEmailPlease@michna.com> - 2014-03-04 09:13 +0100
          Re: Reversing the rows of a table ?? "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2014-03-04 09:49 +0100
        Re: Reversing the rows of a table ?? Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2014-03-04 12:16 +0100
          Re: Reversing the rows of a table ?? "Michael Haufe (TNO)" <tno@thenewobjective.com> - 2014-03-04 06:37 -0800
            Re: Reversing the rows of a table ?? Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2014-03-04 15:56 +0100
              Re: Reversing the rows of a table ?? "Mel Smith" <med_cutout_syntel@aol.com> - 2014-03-04 09:10 -0700
                Re: Reversing the rows of a table ?? Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2014-03-04 17:56 +0100
                Re: Reversing the rows of a table ?? "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2014-03-04 21:47 +0100
                Re: Reversing the rows of a table ?? "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2014-03-04 22:38 +0100
                Re: Reversing the rows of a table ?? "Mel Smith" <med_cutout_syntel@aol.com> - 2014-03-04 15:46 -0700
                Re: Reversing the rows of a table ?? "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2014-03-05 00:18 +0100
                Re: Reversing the rows of a table ?? "Michael Haufe (TNO)" <tno@thenewobjective.com> - 2014-03-04 16:17 -0800
                Re: Reversing the rows of a table ?? "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2014-03-05 09:06 +0100
                Re: Reversing the rows of a table ?? Christoph Michael Becker <cmbecker69@arcor.de> - 2014-03-05 17:49 +0100
                Re: Reversing the rows of a table ?? Christian Winter <thepoet_nospam@arcor.de> - 2014-03-05 06:50 +0100
                Re: Reversing the rows of a table ?? "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2014-03-05 09:07 +0100
                Re: Reversing the rows of a table ?? Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2014-03-05 16:42 +0100
                Re: Reversing the rows of a table ?? Christian Winter <thepoet_nospam@arcor.de> - 2014-03-06 07:28 +0100
                Re: Reversing the rows of a table ?? Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2014-03-06 10:58 +0100
                Re: Reversing the rows of a table ?? "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2014-03-06 11:11 +0100
                Re: Reversing the rows of a table ?? Joao Rodrigues <groups_jr-1@yahoo.com.br> - 2014-03-06 10:35 -0300
              Re: Reversing the rows of a table ?? "Michael Haufe (TNO)" <tno@thenewobjective.com> - 2014-03-04 11:06 -0800
                Re: Reversing the rows of a table ?? "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2014-03-04 20:22 +0100
                Re: Reversing the rows of a table ?? Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2014-03-04 20:55 +0100
  Re: Reversing the rows of a table ?? ompalompasales2@gmail.com - 2014-03-04 12:59 -0800
  Re: Reversing the rows of a table ?? Cezary Tomczyk <cezary.tomczyk@gmail.com> - 2014-03-05 23:05 +0100
    Re: Reversing the rows of a table ?? Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2014-03-05 23:42 +0100
      Re: Reversing the rows of a table ?? Cezary Tomczyk <cezary.tomczyk@gmail.com> - 2014-03-06 14:57 +0100
        Re: Reversing the rows of a table ?? Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2014-03-06 22:37 +0100
          Re: Reversing the rows of a table ?? Cezary Tomczyk <cezary.tomczyk@gmail.com> - 2014-03-06 23:04 +0100
            Re: Reversing the rows of a table ?? Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2014-03-06 23:20 +0100
              Re: Reversing the rows of a table ?? Cezary Tomczyk <cezary.tomczyk@gmail.com> - 2014-03-06 23:31 +0100
                Re: Reversing the rows of a table ?? Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2014-03-07 00:30 +0100
                Re: Reversing the rows of a table ?? Cezary Tomczyk <cezary.tomczyk@gmail.com> - 2014-03-07 18:10 +0100
                Re: Reversing the rows of a table ?? Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2014-03-07 22:49 +0100
            Re: Reversing the rows of a table ?? Joao Rodrigues <groups_jr-1@yahoo.com.br> - 2014-03-06 19:21 -0300
              Re: Reversing the rows of a table ?? Cezary Tomczyk <cezary.tomczyk@gmail.com> - 2014-03-06 23:41 +0100
                Re: Reversing the rows of a table ?? Joao Rodrigues <groups_jr-1@yahoo.com.br> - 2014-03-06 22:45 -0300
    Re: Reversing the rows of a table ?? "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2014-03-05 23:47 +0100
      Re: Reversing the rows of a table ?? Cezary Tomczyk <cezary.tomczyk@gmail.com> - 2014-03-06 14:57 +0100
    Re: Reversing the rows of a table ?? Denis McMahon <denismfmcmahon@gmail.com> - 2014-03-05 23:41 +0000
    Re: Reversing the rows of a table ?? Joao Rodrigues <groups_jr-1@yahoo.com.br> - 2014-03-06 18:56 -0300
      Re: Reversing the rows of a table ?? Cezary Tomczyk <cezary.tomczyk@gmail.com> - 2014-03-06 23:18 +0100
        Re: Reversing the rows of a table ?? Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2014-03-06 23:24 +0100

csiph-web