I have a library I''ve developed that I believe is the most flexible and useful table sorting/striping/row-selecting library around. Big features: Single and multiple-level sort Arbitrary sort criteria (IP address, date, etc.) Works with table headers that are > 1 row or column large Stripe tables and/or enable row selecting Row selecting supports drag-select and SHIFT-click No extra HTML; all CSS and Javascript Optionally creates buttons: "Default Sort", "Select all", etc. Quite fast Pretty good cross-browser support (AFAIK) All the other table-sorting libraries I''ve found try to "guess" what they''re sorting. This library makes no attempt to do so, instead assuming the designer can tell it how to sort by giving it a function for each sortable column that returns a value to be sorted. An example: ----------------- <table id="myTable" class="sortable striped rowsSelectable"> <thead><tr><th>string</th><th>number</th><th>date</th></tr></thead> <tfoot /> <tbody> .......... </tbody> </table> <script type="text/javascript"> document.getElementById(''myTable'').sorterFuncs = [ String, Number, function(str) { var dateSplit = str.split(/\D/); //assume we''re in MM/DD/YYYY format return (dateSplit[2] * 10000) + (dateSplit[0] * 100) + (str[1] * 1); } ]; </script> ---------------------- That''s it. Our table now correctly sorts by clicking on the table headers. If you want, add "multisort" to the table''s class, and you get the equivalent of multiple "ORDER BY" arguments to an SQL statement. Is there interest around in a library like this? -Felipe Gasper Cincinnati, OH -- Felipe M. L. Gasper, conductor/singer http://felipegasper.com Judge ideas, not people. Love people, not ideas.
Do you have a url with a demo for us to see? I can''t see why there wouldn''t be any interest for a library like this, so give us a taste! :) On 9/14/05, Felipe Gasper <gasperfm@uc.edu> wrote:> I have a library I''ve developed that I believe is the most flexible and > useful table sorting/striping/row-selecting library around. > > Big features: > Single and multiple-level sort > Arbitrary sort criteria (IP address, date, etc.) > Works with table headers that are > 1 row or column large > Stripe tables and/or enable row selecting > Row selecting supports drag-select and SHIFT-click > No extra HTML; all CSS and Javascript > Optionally creates buttons: "Default Sort", "Select all", etc. > Quite fast > Pretty good cross-browser support (AFAIK) > > All the other table-sorting libraries I''ve found try to "guess" what > they''re sorting. This library makes no attempt to do so, instead > assuming the designer can tell it how to sort by giving it a function > for each sortable column that returns a value to be sorted. > > An example: > > ----------------- > <table id="myTable" class="sortable striped rowsSelectable"> > <thead><tr><th>string</th><th>number</th><th>date</th></tr></thead> > <tfoot /> > <tbody> > .......... > </tbody> > </table> > > <script type="text/javascript"> > document.getElementById(''myTable'').sorterFuncs = [ > String, > Number, > function(str) { > var dateSplit = str.split(/\D/); > > //assume we''re in MM/DD/YYYY format > return (dateSplit[2] * 10000) > + (dateSplit[0] * 100) > + (str[1] * 1); > } > ]; > </script> > ---------------------- > > That''s it. Our table now correctly sorts by clicking on the table headers. > If you want, add "multisort" to the table''s class, and you get the > equivalent of multiple "ORDER BY" arguments to an SQL statement. > > Is there interest around in a library like this? > > -Felipe Gasper > Cincinnati, OH > > -- > Felipe M. L. Gasper, conductor/singer > http://felipegasper.com > > Judge ideas, not people. > Love people, not ideas. > _______________________________________________ > Rails-spinoffs mailing list > Rails-spinoffs@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs >
The URL in the footer of Felipe''s email links to " http://ccm.uc.edu/sacredmusic/lib/supertable.js" after a couple clicks ;) Hope that helps, Ed C. On 9/14/05, Andrew Kaspick <akaspick@gmail.com> wrote:> > Do you have a url with a demo for us to see? I can''t see why there > wouldn''t be any interest for a library like this, so give us a taste! > :) > > On 9/14/05, Felipe Gasper <gasperfm@uc.edu> wrote: > > I have a library I''ve developed that I believe is the most flexible and > > useful table sorting/striping/row-selecting library around. > > > > Big features: > > Single and multiple-level sort > > Arbitrary sort criteria (IP address, date, etc.) > > Works with table headers that are > 1 row or column large > > Stripe tables and/or enable row selecting > > Row selecting supports drag-select and SHIFT-click > > No extra HTML; all CSS and Javascript > > Optionally creates buttons: "Default Sort", "Select all", etc. > > Quite fast > > Pretty good cross-browser support (AFAIK) > > > > All the other table-sorting libraries I''ve found try to "guess" what > > they''re sorting. This library makes no attempt to do so, instead > > assuming the designer can tell it how to sort by giving it a function > > for each sortable column that returns a value to be sorted. > > > > An example: > > > > ----------------- > > <table id="myTable" class="sortable striped rowsSelectable"> > > <thead><tr><th>string</th><th>number</th><th>date</th></tr></thead> > > <tfoot /> > > <tbody> > > .......... > > </tbody> > > </table> > > > > <script type="text/javascript"> > > document.getElementById(''myTable'').sorterFuncs = [ > > String, > > Number, > > function(str) { > > var dateSplit = str.split(/\D/); > > > > //assume we''re in MM/DD/YYYY format > > return (dateSplit[2] * 10000) > > + (dateSplit[0] * 100) > > + (str[1] * 1); > > } > > ]; > > </script> > > ---------------------- > > > > That''s it. Our table now correctly sorts by clicking on the table > headers. > > If you want, add "multisort" to the table''s class, and you get the > > equivalent of multiple "ORDER BY" arguments to an SQL statement. > > > > Is there interest around in a library like this? > > > > -Felipe Gasper > > Cincinnati, OH > > > > -- > > Felipe M. L. Gasper, conductor/singer > > http://felipegasper.com > > > > Judge ideas, not people. > > Love people, not ideas. > > _______________________________________________ > > Rails-spinoffs mailing list > > Rails-spinoffs@lists.rubyonrails.org > > http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs > > > _______________________________________________ > Rails-spinoffs mailing list > Rails-spinoffs@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs >-------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails-spinoffs/attachments/20050914/37a7d698/attachment.html
Yeah, that''s an old link. A new one, with demo, is: http://fshn-dads.foods.uiuc.edu/demo/supertable-demo.html Comments/suggestions welcome. -FG Quoth Ed C. on 9/14/2005 9:32 PM...> The URL in the footer of Felipe''s email links to > "http://ccm.uc.edu/sacredmusic/lib/supertable.js" after a couple clicks ;) > > Hope that helps, Ed C. > > On 9/14/05, *Andrew Kaspick* <akaspick@gmail.com > <mailto:akaspick@gmail.com>> wrote: > > Do you have a url with a demo for us to see? I can''t see why there > wouldn''t be any interest for a library like this, so give us a taste! > :) > > On 9/14/05, Felipe Gasper <gasperfm@uc.edu <mailto:gasperfm@uc.edu>> > wrote: > > I have a library I''ve developed that I believe is the most > flexible and > > useful table sorting/striping/row-selecting library around. > > > > Big features: > > Single and multiple-level sort > > Arbitrary sort criteria (IP address, date, etc.) > > Works with table headers that are > 1 row or column large > > Stripe tables and/or enable row selecting > > Row selecting supports drag-select and SHIFT-click > > No extra HTML; all CSS and Javascript > > Optionally creates buttons: "Default Sort", "Select all", etc. > > Quite fast > > Pretty good cross-browser support (AFAIK) > > > > All the other table-sorting libraries I''ve found try to "guess" what > > they''re sorting. This library makes no attempt to do so, instead > > assuming the designer can tell it how to sort by giving it a function > > for each sortable column that returns a value to be sorted. > > > > An example: > > > > ----------------- > > <table id="myTable" class="sortable striped rowsSelectable"> > > <thead><tr><th>string</th><th>number</th><th>date</th></tr></thead> > > <tfoot /> > > <tbody> > > .......... > > </tbody> > > </table> > > > > <script type="text/javascript"> > > document.getElementById(''myTable'').sorterFuncs = [ > > String, > > Number, > > function(str) { > > var dateSplit = str.split(/\D/); > > > > //assume we''re in MM/DD/YYYY format > > return (dateSplit[2] * 10000) > > + (dateSplit[0] * 100) > > + (str[1] * 1); > > } > > ]; > > </script> > > ---------------------- > > > > That''s it. Our table now correctly sorts by clicking on the table > headers. > > If you want, add "multisort" to the table''s class, and you get the > > equivalent of multiple "ORDER BY" arguments to an SQL statement. > > > > Is there interest around in a library like this? > > > > -Felipe Gasper > > Cincinnati, OH > > > > -- > > Felipe M. L. Gasper, conductor/singer > > http://felipegasper.com > > > > Judge ideas, not people. > > Love people, not ideas. > > _______________________________________________ > > Rails-spinoffs mailing list > > Rails-spinoffs@lists.rubyonrails.org > <mailto:Rails-spinoffs@lists.rubyonrails.org> > > http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs > <http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs> > > > _______________________________________________ > Rails-spinoffs mailing list > Rails-spinoffs@lists.rubyonrails.org > <mailto:Rails-spinoffs@lists.rubyonrails.org> > http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs > > > > ------------------------------------------------------------------------ > > _______________________________________________ > Rails-spinoffs mailing list > Rails-spinoffs@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs-- Felipe M. L. Gasper, conductor/singer http://felipegasper.com Judge ideas, not people. Love people, not ideas.
Samuel Dionne-Riel
2005-Sep-14 22:04 UTC
[Rails-spinoffs] table sorting/manipulation library?
Nice, but in FF, when we sort Another column, it sorts it with the previously sorted one in mind... quite boring... Make it an option !> Yeah, that''s an old link. A new one, with demo, is: > > http://fshn-dads.foods.uiuc.edu/demo/supertable-demo.html > > Comments/suggestions welcome. > > -FG > > Quoth Ed C. on 9/14/2005 9:32 PM... >> The URL in the footer of Felipe''s email links to >> "http://ccm.uc.edu/sacredmusic/lib/supertable.js" after a couple clicks >> ;) >> >> Hope that helps, Ed C. >> >> On 9/14/05, *Andrew Kaspick* <akaspick@gmail.com >> <mailto:akaspick@gmail.com>> wrote: >> >> Do you have a url with a demo for us to see? I can''t see why there >> wouldn''t be any interest for a library like this, so give us a >> taste! >> :) >> >> On 9/14/05, Felipe Gasper <gasperfm@uc.edu <mailto:gasperfm@uc.edu>> >> wrote: >> > I have a library I''ve developed that I believe is the most >> flexible and >> > useful table sorting/striping/row-selecting library around. >> > >> > Big features: >> > Single and multiple-level sort >> > Arbitrary sort criteria (IP address, date, etc.) >> > Works with table headers that are > 1 row or column large >> > Stripe tables and/or enable row selecting >> > Row selecting supports drag-select and SHIFT-click >> > No extra HTML; all CSS and Javascript >> > Optionally creates buttons: "Default Sort", "Select all", etc. >> > Quite fast >> > Pretty good cross-browser support (AFAIK) >> > >> > All the other table-sorting libraries I''ve found try to "guess" >> what >> > they''re sorting. This library makes no attempt to do so, instead >> > assuming the designer can tell it how to sort by giving it a >> function >> > for each sortable column that returns a value to be sorted. >> > >> > An example: >> > >> > ----------------- >> > <table id="myTable" class="sortable striped rowsSelectable"> >> > <thead><tr><th>string</th><th>number</th><th>date</th></tr></thead> >> > <tfoot /> >> > <tbody> >> > .......... >> > </tbody> >> > </table> >> > >> > <script type="text/javascript"> >> > document.getElementById(''myTable'').sorterFuncs = [ >> > String, >> > Number, >> > function(str) { >> > var dateSplit = str.split(/\D/); >> > >> > //assume we''re in MM/DD/YYYY format >> > return (dateSplit[2] * 10000) >> > + (dateSplit[0] * 100) >> > + (str[1] * 1); >> > } >> > ]; >> > </script> >> > ---------------------- >> > >> > That''s it. Our table now correctly sorts by clicking on the table >> headers. >> > If you want, add "multisort" to the table''s class, and you get >> the >> > equivalent of multiple "ORDER BY" arguments to an SQL statement. >> > >> > Is there interest around in a library like this? >> > >> > -Felipe Gasper >> > Cincinnati, OH >> > >> > -- >> > Felipe M. L. Gasper, conductor/singer >> > http://felipegasper.com >> > >> > Judge ideas, not people. >> > Love people, not ideas. >> > _______________________________________________ >> > Rails-spinoffs mailing list >> > Rails-spinoffs@lists.rubyonrails.org >> <mailto:Rails-spinoffs@lists.rubyonrails.org> >> > http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs >> <http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs> >> > >> _______________________________________________ >> Rails-spinoffs mailing list >> Rails-spinoffs@lists.rubyonrails.org >> <mailto:Rails-spinoffs@lists.rubyonrails.org> >> http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs >> >> >> >> ------------------------------------------------------------------------ >> >> _______________________________________________ >> Rails-spinoffs mailing list >> Rails-spinoffs@lists.rubyonrails.org >> http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs > > -- > Felipe M. L. Gasper, conductor/singer > http://felipegasper.com > > Judge ideas, not people. > Love people, not ideas. > _______________________________________________ > Rails-spinoffs mailing list > Rails-spinoffs@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs >???????????????????????? http://www.samueldr.com http://www.hostingquebec.ca
Really cool. Though on Safari, it doesn''t seem to work for me. Mark On Sep 14, 2005, at 10:04 PM, Felipe Gasper wrote:> Yeah, that''s an old link. A new one, with demo, is: > > http://fshn-dads.foods.uiuc.edu/demo/supertable-demo.html > > Comments/suggestions welcome. > > -FG > > Quoth Ed C. on 9/14/2005 9:32 PM... > >> The URL in the footer of Felipe''s email links to "http:// >> ccm.uc.edu/sacredmusic/lib/supertable.js" after a couple clicks ;) >> Hope that helps, Ed C. >> On 9/14/05, *Andrew Kaspick* <akaspick@gmail.com >> <mailto:akaspick@gmail.com>> wrote: >> Do you have a url with a demo for us to see? I can''t see why >> there >> wouldn''t be any interest for a library like this, so give us a >> taste! >> :) >> On 9/14/05, Felipe Gasper <gasperfm@uc.edu >> <mailto:gasperfm@uc.edu>> >> wrote: >> > I have a library I''ve developed that I believe is the most >> flexible and >> > useful table sorting/striping/row-selecting library around. >> > >> > Big features: >> > Single and multiple-level sort >> > Arbitrary sort criteria (IP address, date, etc.) >> > Works with table headers that are > 1 row or column large >> > Stripe tables and/or enable row selecting >> > Row selecting supports drag-select and SHIFT-click >> > No extra HTML; all CSS and Javascript >> > Optionally creates buttons: "Default Sort", "Select all", etc. >> > Quite fast >> > Pretty good cross-browser support (AFAIK) >> > >> > All the other table-sorting libraries I''ve found try to >> "guess" what >> > they''re sorting. This library makes no attempt to do so, >> instead >> > assuming the designer can tell it how to sort by giving it >> a function >> > for each sortable column that returns a value to be sorted. >> > >> > An example: >> > >> > ----------------- >> > <table id="myTable" class="sortable striped rowsSelectable"> >> > <thead><tr><th>string</th><th>number</th><th>date</th></ >> tr></thead> >> > <tfoot /> >> > <tbody> >> > .......... >> > </tbody> >> > </table> >> > >> > <script type="text/javascript"> >> > document.getElementById(''myTable'').sorterFuncs = [ >> > String, >> > Number, >> > function(str) { >> > var dateSplit = str.split(/\D/); >> > >> > //assume we''re in MM/DD/YYYY format >> > return (dateSplit[2] * 10000) >> > + (dateSplit[0] * 100) >> > + (str[1] * 1); >> > } >> > ]; >> > </script> >> > ---------------------- >> > >> > That''s it. Our table now correctly sorts by clicking on the >> table >> headers. >> > If you want, add "multisort" to the table''s class, and you >> get the >> > equivalent of multiple "ORDER BY" arguments to an SQL >> statement. >> > >> > Is there interest around in a library like this? >> > >> > -Felipe Gasper >> > Cincinnati, OH >> > >> > -- >> > Felipe M. L. Gasper, conductor/singer >> > http://felipegasper.com >> > >> > Judge ideas, not people. >> > Love people, not ideas. >> > _______________________________________________ >> > Rails-spinoffs mailing list >> > Rails-spinoffs@lists.rubyonrails.org >> <mailto:Rails-spinoffs@lists.rubyonrails.org> >> > http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs >> <http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs> >> > >> _______________________________________________ >> Rails-spinoffs mailing list >> Rails-spinoffs@lists.rubyonrails.org >> <mailto:Rails-spinoffs@lists.rubyonrails.org> >> http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs >> --------------------------------------------------------------------- >> --- >> _______________________________________________ >> Rails-spinoffs mailing list >> Rails-spinoffs@lists.rubyonrails.org >> http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs >> > > -- > Felipe M. L. Gasper, conductor/singer > http://felipegasper.com > > Judge ideas, not people. > Love people, not ideas. > _______________________________________________ > Rails-spinoffs mailing list > Rails-spinoffs@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs > >
Right - the JS source offers it as an option. If you want to change it dynamically, add/remove the "multiSortable" class from the table. -FG Quoth Samuel Dionne-Riel on 9/14/2005 10:15 PM...> Nice, but in FF, when we sort Another column, it sorts it with the > previously sorted one in mind... quite boring... > > Make it an option ! > > >>Yeah, that''s an old link. A new one, with demo, is: >> >>http://fshn-dads.foods.uiuc.edu/demo/supertable-demo.html >> >>Comments/suggestions welcome. >> >>-FG >> >>Quoth Ed C. on 9/14/2005 9:32 PM... >> >>>The URL in the footer of Felipe''s email links to >>>"http://ccm.uc.edu/sacredmusic/lib/supertable.js" after a couple clicks >>>;) >>> >>>Hope that helps, Ed C. >>> >>>On 9/14/05, *Andrew Kaspick* <akaspick@gmail.com >>><mailto:akaspick@gmail.com>> wrote: >>> >>> Do you have a url with a demo for us to see? I can''t see why there >>> wouldn''t be any interest for a library like this, so give us a >>>taste! >>> :) >>> >>> On 9/14/05, Felipe Gasper <gasperfm@uc.edu <mailto:gasperfm@uc.edu>> >>> wrote: >>> > I have a library I''ve developed that I believe is the most >>> flexible and >>> > useful table sorting/striping/row-selecting library around. >>> > >>> > Big features: >>> > Single and multiple-level sort >>> > Arbitrary sort criteria (IP address, date, etc.) >>> > Works with table headers that are > 1 row or column large >>> > Stripe tables and/or enable row selecting >>> > Row selecting supports drag-select and SHIFT-click >>> > No extra HTML; all CSS and Javascript >>> > Optionally creates buttons: "Default Sort", "Select all", etc. >>> > Quite fast >>> > Pretty good cross-browser support (AFAIK) >>> > >>> > All the other table-sorting libraries I''ve found try to "guess" >>>what >>> > they''re sorting. This library makes no attempt to do so, instead >>> > assuming the designer can tell it how to sort by giving it a >>>function >>> > for each sortable column that returns a value to be sorted. >>> > >>> > An example: >>> > >>> > ----------------- >>> > <table id="myTable" class="sortable striped rowsSelectable"> >>> > <thead><tr><th>string</th><th>number</th><th>date</th></tr></thead> >>> > <tfoot /> >>> > <tbody> >>> > .......... >>> > </tbody> >>> > </table> >>> > >>> > <script type="text/javascript"> >>> > document.getElementById(''myTable'').sorterFuncs = [ >>> > String, >>> > Number, >>> > function(str) { >>> > var dateSplit = str.split(/\D/); >>> > >>> > //assume we''re in MM/DD/YYYY format >>> > return (dateSplit[2] * 10000) >>> > + (dateSplit[0] * 100) >>> > + (str[1] * 1); >>> > } >>> > ]; >>> > </script> >>> > ---------------------- >>> > >>> > That''s it. Our table now correctly sorts by clicking on the table >>> headers. >>> > If you want, add "multisort" to the table''s class, and you get >>>the >>> > equivalent of multiple "ORDER BY" arguments to an SQL statement. >>> > >>> > Is there interest around in a library like this? >>> > >>> > -Felipe Gasper >>> > Cincinnati, OH >>> > >>> > -- >>> > Felipe M. L. Gasper, conductor/singer >>> > http://felipegasper.com >>> > >>> > Judge ideas, not people. >>> > Love people, not ideas. >>> > _______________________________________________ >>> > Rails-spinoffs mailing list >>> > Rails-spinoffs@lists.rubyonrails.org >>> <mailto:Rails-spinoffs@lists.rubyonrails.org> >>> > http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs >>> <http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs> >>> > >>> _______________________________________________ >>> Rails-spinoffs mailing list >>> Rails-spinoffs@lists.rubyonrails.org >>> <mailto:Rails-spinoffs@lists.rubyonrails.org> >>> http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs >>> >>> >>> >>>------------------------------------------------------------------------ >>> >>>_______________________________________________ >>>Rails-spinoffs mailing list >>>Rails-spinoffs@lists.rubyonrails.org >>>http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs >> >>-- >>Felipe M. L. Gasper, conductor/singer >>http://felipegasper.com >> >>Judge ideas, not people. >>Love people, not ideas. >>_______________________________________________ >>Rails-spinoffs mailing list >>Rails-spinoffs@lists.rubyonrails.org >>http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs >> > > > > ???????????????????????? > http://www.samueldr.com > http://www.hostingquebec.ca > > _______________________________________________ > Rails-spinoffs mailing list > Rails-spinoffs@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs >-- Felipe M. L. Gasper, conductor/singer http://felipegasper.com Judge ideas, not people. Love people, not ideas.
Hm - I don''t have access to a Safari box. Any idea what might be the caveat. I know that Safari, before the very latest version, had issues with its table properties like sectionRowIndex, rowIndex, cellIndex, rows, cells, etc. -FG Quoth Mark McCray on 9/14/2005 10:13 PM...> Really cool. > Though on Safari, it doesn''t seem to work for me. > Mark > > > On Sep 14, 2005, at 10:04 PM, Felipe Gasper wrote: > >> Yeah, that''s an old link. A new one, with demo, is: >> >> http://fshn-dads.foods.uiuc.edu/demo/supertable-demo.html >> >> Comments/suggestions welcome. >> >> -FG >> >> Quoth Ed C. on 9/14/2005 9:32 PM... >> >>> The URL in the footer of Felipe''s email links to "http:// >>> ccm.uc.edu/sacredmusic/lib/supertable.js" after a couple clicks ;) >>> Hope that helps, Ed C. >>> On 9/14/05, *Andrew Kaspick* <akaspick@gmail.com >>> <mailto:akaspick@gmail.com>> wrote: >>> Do you have a url with a demo for us to see? I can''t see why there >>> wouldn''t be any interest for a library like this, so give us a >>> taste! >>> :) >>> On 9/14/05, Felipe Gasper <gasperfm@uc.edu >>> <mailto:gasperfm@uc.edu>> >>> wrote: >>> > I have a library I''ve developed that I believe is the most >>> flexible and >>> > useful table sorting/striping/row-selecting library around. >>> > >>> > Big features: >>> > Single and multiple-level sort >>> > Arbitrary sort criteria (IP address, date, etc.) >>> > Works with table headers that are > 1 row or column large >>> > Stripe tables and/or enable row selecting >>> > Row selecting supports drag-select and SHIFT-click >>> > No extra HTML; all CSS and Javascript >>> > Optionally creates buttons: "Default Sort", "Select all", etc. >>> > Quite fast >>> > Pretty good cross-browser support (AFAIK) >>> > >>> > All the other table-sorting libraries I''ve found try to >>> "guess" what >>> > they''re sorting. This library makes no attempt to do so, instead >>> > assuming the designer can tell it how to sort by giving it a >>> function >>> > for each sortable column that returns a value to be sorted. >>> > >>> > An example: >>> > >>> > ----------------- >>> > <table id="myTable" class="sortable striped rowsSelectable"> >>> > <thead><tr><th>string</th><th>number</th><th>date</th></ >>> tr></thead> >>> > <tfoot /> >>> > <tbody> >>> > .......... >>> > </tbody> >>> > </table> >>> > >>> > <script type="text/javascript"> >>> > document.getElementById(''myTable'').sorterFuncs = [ >>> > String, >>> > Number, >>> > function(str) { >>> > var dateSplit = str.split(/\D/); >>> > >>> > //assume we''re in MM/DD/YYYY format >>> > return (dateSplit[2] * 10000) >>> > + (dateSplit[0] * 100) >>> > + (str[1] * 1); >>> > } >>> > ]; >>> > </script> >>> > ---------------------- >>> > >>> > That''s it. Our table now correctly sorts by clicking on the >>> table >>> headers. >>> > If you want, add "multisort" to the table''s class, and you >>> get the >>> > equivalent of multiple "ORDER BY" arguments to an SQL statement. >>> > >>> > Is there interest around in a library like this? >>> > >>> > -Felipe Gasper >>> > Cincinnati, OH >>> > >>> > -- >>> > Felipe M. L. Gasper, conductor/singer >>> > http://felipegasper.com >>> > >>> > Judge ideas, not people. >>> > Love people, not ideas. >>> > _______________________________________________ >>> > Rails-spinoffs mailing list >>> > Rails-spinoffs@lists.rubyonrails.org >>> <mailto:Rails-spinoffs@lists.rubyonrails.org> >>> > http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs >>> <http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs> >>> > >>> _______________________________________________ >>> Rails-spinoffs mailing list >>> Rails-spinoffs@lists.rubyonrails.org >>> <mailto:Rails-spinoffs@lists.rubyonrails.org> >>> http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs >>> --------------------------------------------------------------------- >>> --- >>> _______________________________________________ >>> Rails-spinoffs mailing list >>> Rails-spinoffs@lists.rubyonrails.org >>> http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs >>> >> >> -- >> Felipe M. L. Gasper, conductor/singer >> http://felipegasper.com >> >> Judge ideas, not people. >> Love people, not ideas. >> _______________________________________________ >> Rails-spinoffs mailing list >> Rails-spinoffs@lists.rubyonrails.org >> http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs >> >> > > _______________________________________________ > Rails-spinoffs mailing list > Rails-spinoffs@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs-- Felipe M. L. Gasper, conductor/singer http://felipegasper.com Judge ideas, not people. Love people, not ideas.
>> Yeah, that''s an old link. A new one, with demo, is: >> http://fshn-dads.foods.uiuc.edu/demo/supertable-demo.html >Doesn''t work at all for me in Safari 2.0.1. Works ok in Firefox on the Mac. Have to agree that the behaviour of "additive" sorting feels very wrong to me. If I sort first by one column, then by another, I intend to do a completely new sort, not a further refinement of the first sort. In other words, the default behavior probably should be like Excel''s column sorting or other table sorts.
In response to these mails, the demo now offers multi-sort as a checkbox-enabled option; the default is single-sort. Guess I gotta get myself to a Safari box and figure out what''s wrong. (Any input would be welcome.) Also, FYI, this library''s row-selecting exposes a very annoying CSS bug in Opera (that goes back at least a couple versions). -FG Quoth Andrew Otwell on 9/14/2005 10:41 PM...> >>> Yeah, that''s an old link. A new one, with demo, is: >>> http://fshn-dads.foods.uiuc.edu/demo/supertable-demo.html >> >> > > Doesn''t work at all for me in Safari 2.0.1. Works ok in Firefox on the > Mac. > > Have to agree that the behaviour of "additive" sorting feels very wrong > to me. If I sort first by one column, then by another, I intend to do a > completely new sort, not a further refinement of the first sort. In > other words, the default behavior probably should be like Excel''s > column sorting or other table sorts. > > _______________________________________________ > Rails-spinoffs mailing list > Rails-spinoffs@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs-- Felipe M. L. Gasper, conductor/singer http://felipegasper.com Judge ideas, not people. Love people, not ideas.
Martin Bialasinski
2005-Sep-15 09:01 UTC
[Rails-spinoffs] table sorting/manipulation library?
On 15/09/05, Felipe Gasper <gasperfm@uc.edu> wrote: Hello, looks nice :-)> In response to these mails, the demo now offers multi-sort as a > checkbox-enabled option; the default is single-sort.It seems to be broken. Check multisort, sort by name, sort by age. sorting by age will just turn the Stallmanns around. I also think, sorting by name should sort by the first letter shown, not the last name. It hinders to visual scanning otherwise. If you want to sort by last name, make the entries "lastname, firstname". I just notice: multisort is broken in other ways too. It never plays good after the first column is selected. Also, for the multisort, the columns need three states, "desc, asc, nosort", so you can remove a column from the sorting order.> Also, FYI, this library''s row-selecting exposes a very annoying CSS bug > in Opera (that goes back at least a couple versions).If you mean the artifacts on coloring: Do a document.body.style.display="none"; document.body.style.display=""; to refresh the screen and everything will be well. Bye, Martin
On 15-Sep-05, at 9:04 AM, Martin Bialasinski wrote:> On 15/09/05, Felipe Gasper <gasperfm@uc.edu> wrote: >> In response to these mails, the demo now offers multi-sort as a >> checkbox-enabled option; the default is single-sort. > > It seems to be broken. Check multisort, sort by name, sort by age. > sorting by age will just turn the Stallmanns around.As opposed to what? That seems like the right behaviour to me... However, if I change my mind and want to sort by age then name, I''m stuck; tri-state sorting as you suggested would help, but I think multi-sort mode is always going to be a bit confusing since there''s no indication of what the column sort order is. Or is that an option that could be turned on? L. -- Laurie Harper Open Source advocate, Java geek: http://www.holoweb.net/laurie Founder, Zotech Software: http://www.zotechsoftware.com/
Michael Schuerig
2005-Sep-15 19:57 UTC
[Rails-spinoffs] Re: table sorting/manipulation library?
On Friday 16 September 2005 01:45, Laurie Harper wrote:> On 15-Sep-05, at 9:04 AM, Martin Bialasinski wrote: > > On 15/09/05, Felipe Gasper <gasperfm@uc.edu> wrote: > >> In response to these mails, the demo now offers multi-sort as a > >> checkbox-enabled option; the default is single-sort. > > > > It seems to be broken. Check multisort, sort by name, sort by age. > > sorting by age will just turn the Stallmanns around. > > As opposed to what? That seems like the right behaviour to me... > However, if I change my mind and want to sort by age then name, I''m > stuck; tri-state sorting as you suggested would help, but I think > multi-sort mode is always going to be a bit confusing since there''s > no indication of what the column sort order is. Or is that an option > that could be turned on?Another option: Allow reordering of columns and prioritize columns from left to right. That''s what I''m doing in BoilerPlate, although the sorting is server-side. It''s logical, but I''m afraid that it will confuse users nevertheless. Michael -- Michael Schuerig Face reality and stare it down mailto:michael@schuerig.de --Jethro Tull, Silver River Turning http://www.schuerig.de/michael/
Felipe Gasper
2005-Sep-15 22:34 UTC
[Rails-spinoffs] Re: table sorting/manipulation library?
Quoth Michael Schuerig on Fri, 16 Sep 2005...> On Friday 16 September 2005 01:45, Laurie Harper wrote: > > On 15-Sep-05, at 9:04 AM, Martin Bialasinski wrote: > > > On 15/09/05, Felipe Gasper <gasperfm@uc.edu> wrote: > > >> In response to these mails, the demo now offers multi-sort as a > > >> checkbox-enabled option; the default is single-sort. > > > > > > It seems to be broken. Check multisort, sort by name, sort by age. > > > sorting by age will just turn the Stallmanns around. > > > > As opposed to what? That seems like the right behaviour to me... > > However, if I change my mind and want to sort by age then name, I''m > > stuck; tri-state sorting as you suggested would help, but I think > > multi-sort mode is always going to be a bit confusing since there''s > > no indication of what the column sort order is. Or is that an option > > that could be turned on? > > Another option: Allow reordering of columns and prioritize columns from > left to right. > > That''s what I''m doing in BoilerPlate, although the sorting is > server-side. It''s logical, but I''m afraid that it will confuse users > nevertheless. >So you''re saying make it able to drag-drop columns? Hmm.....that''d be hard to implement in this library because it accomodates headers that span multiple columns and multiple rows. However, it would seem feasible, should someone want to do this, to apply drag/drop code from elsewhere to my code, as long as you''re doing one-header-per-column. I didn''t mention this last night, but this table library is almost completely dynamic: add/subtract rows, headers, columns, and the library doesn''t blink twice. (Just re-stripe if you add rows.) Does anyone have interest in drag/drop columns with this library? If so, let me know; the code would require some modification that I''m otherwise hesitant to put in. -FG -- Felipe M. L. Gasper, conductor/singer http://felipegasper.com Judge ideas, not people. Love people, not ideas.