Prev: SlickSpeed: jquery vs mylib
Next: FAQ Topic - How do I format a Date object with javascript? (2010-01-27)
From: dorayme on 26 Jan 2010 18:01 In article <5c84300d-b57e-47f0-b337-ca4d26aa8139(a)o36g2000vbl.googlegroups.co m>, Matt Kruse <matt(a)thekrusefamily.com> wrote: > On Jan 26, 4:19 pm, dorayme <doraymeRidT...(a)optusnet.com.au> wrote: > > What is best js to provide for client side column sorting with > > html tables? Be nice to have the cursor change to a hand on > > hovering the table headings. Thank you. > > Check out mine: > > http://JavascriptToolbox.com/lib/table/ > > It does sorting, striping, filtering, and paging in lib. > > It's flexible, extensible, and extremely fast. In tests I did at the > time of writing, I couldn't find any table-sorting solution that was > faster. Especially in browsers like IE6, where some unconventional > internal optimizations make a big difference. > > It also does things like correctly handling colspans in headers, > respecting footers & separate tbody's, allowing some tbody's to be > left unsorted, letting you define your own data type for columns, etc. > > If you have any feedback, I would love to hear it! > It looks very good indeed and thanks very much. It does more than I actually want but it has the features I want. I will study the documentation and have a go. -- dorayme
From: dorayme on 26 Jan 2010 18:09 In article <hjnp5f$oa4$1(a)newsreader2.utanet.at>, Gregor Kofler <usenet(a)gregorkofler.com> wrote: > dorayme meinte: > > What is best js to provide for client side column sorting with > > html tables? Be nice to have the cursor change to a hand on > > hovering the table headings. Thank you. > > What do you mean by "best"? (And what is "simplest")? > To explain this would mean explaining about me too much. I don't want to get too personal at the moment! > Ive done my own one[1]. The sorting itself is done with JS "native" > Array.sort() method (which I suppose uses the quicksort algorithm). > > Once sorted, the table rows are exchanged accordingly. It's all > relatively simple (and the script a mere 4k). My sortable table was > somewhat faster than two or three alternatives I checked out. Rebuilding > the table object with the neccessary reflow eat up most of the time. > > Cursor appearance can be done with CSS. Most of the alternatives out > there provide more options, but are too bloated for my liking and/or > rely on one of those "general purpose" libraries. > > Gregor > > > [1] > http://vxjs.gregorkofler.com/?page=sortable Thanks Gregor, I will study this. My needs are dead simple. Just to sort the likes of: <http://dorayme.netweaver.com.au/tableSortCandidate.html> and have the hand cursor (easy enough for me to work out). -- dorayme
From: Lasse Reichstein Nielsen on 27 Jan 2010 01:05 Gregor Kofler <usenet(a)gregorkofler.com> writes: > The sorting itself is done with JS "native" > Array.sort() method (which I suppose uses the quicksort algorithm). That differs between browsers/JavaScript implementations. From the open source browsers: http://trac.webkit.org/browser/trunk/JavaScriptCore/runtime/ArrayPrototype.cpp (the function arrayProtoFuncSort, "min"-sort - a fairly simple algorithm with a guaranteed quadratic number of comparisons, but low overhead.) http://code.google.com/p/v8/source/browse/branches/bleeding_edge/src/array.js (the function ArraySort, quicksort with insertion-sort as base for recursion) http://mxr.mozilla.org/seamonkey/source/js/src/jsarray.c (the function js_MergeSort, merge-sort-based, if you trust the name :) /L -- Lasse Reichstein Holst Nielsen 'Javascript frameworks is a disruptive technology'
From: RobG on 27 Jan 2010 01:44 On Jan 27, 8:48 am, Matt Kruse <m...(a)thekrusefamily.com> wrote: > On Jan 26, 4:19 pm, dorayme <doraymeRidT...(a)optusnet.com.au> wrote: > > > What is best js to provide for client side column sorting with > > html tables? Be nice to have the cursor change to a hand on > > hovering the table headings. Thank you. > > Check out mine: > > http://JavascriptToolbox.com/lib/table/ > > It does sorting, striping, filtering, and paging in lib. The supported date formats do not seem to include the one that is probably most commonly used - d/m/yyyy. -- Rob > > It's flexible, extensible, and extremely fast. In tests I did at the > time of writing, I couldn't find any table-sorting solution that was > faster. Especially in browsers like IE6, where some unconventional > internal optimizations make a big difference. > > It also does things like correctly handling colspans in headers, > respecting footers & separate tbody's, allowing some tbody's to be > left unsorted, letting you define your own data type for columns, etc. > > If you have any feedback, I would love to hear it! > > Matt Kruse
From: Gregor Kofler on 27 Jan 2010 05:58
Lasse Reichstein Nielsen meinte: > Gregor Kofler <usenet(a)gregorkofler.com> writes: > >> The sorting itself is done with JS "native" >> Array.sort() method (which I suppose uses the quicksort algorithm). > > That differs between browsers/JavaScript implementations. Interesting. I had then replaced the built-in sort with my "own" quicksort function and it was only slighlty slower. Since the sorting itself wasn't an issue when compared to the "speed" of the required DOM operations, I didn't investigate any further and stuck to the built-in algorithm (according to the various Wikipedia articles quicksort, mergesort and minsort don't differ too much in terms of speed). Gregor -- http://www.gregorkofler.com |