Re: Is it possible to sort a collection of XML childNodes?



bissatch@xxxxxxxxxxx wrote:
Hi,

I am about to create a table, where the values are taken from an XML
file, where each column header you can click and it will sort the table
rows at the client side.

Typically records are sorted at the server when they are extracted from the database so that they have some default (or maybe user defined) order when first presented. Once you've created HTML from them, the browser script does the sorting thereafter. You may have a cookie that remembers the current sort column and uses it the next time the site is visited.


There are a number of JavaScript-based table sort routines available, some allow sorting of the table at the client when it is first loaded.

There are other techniques using XSL but last time I tried that (some time ago) it was very browser-specific and slow. Things may have improved but I think XSL/T has either moved to the server or been largely ignored.


[...]


Reasonable table sort routine on Matt Kruze's site:

<URL:http://www.mattkruse.com/javascript/sorttable/>

Recent thread discussing table sort:

<URL:http://groups-beta.google.com/group/comp.lang.javascript/tree/browse_frm/thread/d2e13db951e3db77/b3fdc2615655cf3d?rnum=1&hl=en&q=sort+table&_done=%2Fgroup%2Fcomp.lang.javascript%2Fbrowse_frm%2Fthread%2Fd2e13db951e3db77%2F757b0bb0092a4b7d%3Fq%3Dsort+table%26rnum%3D2%26hl%3Den%26#doc_b3fdc2615655cf3d>


-- Rob .



Relevant Pages

  • Re: Sorting in datagrid
    ... indication not to sort even though it sounds like a Single table bind. ... > The data from the array of objects is displayed by means of a table style, ... > On the other hand, when I set the datasource to a data table, sorting ... > on column header click. ...
    (microsoft.public.dotnet.languages.vb)
  • RE: How can I sort "oldest to newest?"
    ... Sorting "A to Z" means to sort in ascending order. ... column header and then the "sort xxx to xxx" icon. ...
    (microsoft.public.excel.newusers)
  • Re: sorting a tstringgrid
    ... There are several third party components out there that has sorting ... built in.... ... column header to sort by it. ...
    (alt.comp.lang.borland-delphi)
  • Re: Sorting Pics
    ... I suspect you may have used some quite old editing photo software. ... there is way less info then in the ones that sort ... Right click on the column header "name" ... This will add a new column "Date Picture Taken". ...
    (microsoft.public.windowsxp.photos)
  • Re: Transfer AutoFiler list to a ComboBox
    ... 'Define name for original data ... 'starting with column header in cell A1. ... 'Use another worksheet for unique data ... 'Clear any existing sort fields. ...
    (microsoft.public.excel.programming)