• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Sorting of Table

 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have a quick question for you.
I have a table with three columns. The table is generated dynamically so can�t tell about the rows. Once data has been displayed user can sort (ascending or descending) the data of table by clicking the any of the header.
Awaiting reply.
Dhaval
 
Ranch Hand
Posts: 884
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
So what's the issue actually? You've some codes that need help in debugging? Or you need suggestions on how to approach your problem?
Anyway, you need to be more specific in your question, if not its rather difficult to help you.
I'm assuming that each row of your table is essentially a Javabean. So you can actually use Comparator to sort them according to your needs (column).
 
Sheriff
Posts: 7023
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Welcome to JavaRanch, Dhaval!
In what context is your GUI running? Is it a web page of a web application? Is it a Swing / AWT based GUI?
Either way, you're possibly going to be taking advantage of the compareTo method of the Comparable interface.
 
Dhaval Shah
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Guys,
Let me be more elaborate on this. I am fetching data from database and displaying it on web page (html) in a table format. By clicking the header of the table I want to sort the data of table with the help of javascript.
This can be done by going back to server, fetching the data according to new sorting order and display it again. But instead of going back to server I want to use javascript if available.
Thanks in Advance,
Dhaval
 
Dirk Schreckmann
Sheriff
Posts: 7023
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
JavaScript is not Java.
Let me repeat. JavaScript is not Java.
Say it ten times.
JavaScript is not Java.
JavaScript is not Java.
JavaScript is not Java.
JavaScript is not Java.
JavaScript is not Java.
JavaScript is not Java.
JavaScript is not Java.
JavaScript is not Java.
JavaScript is not Java.
JavaScript is not Java.
Moving this to the HTML and JavaScript forum...
[ April 28, 2004: Message edited by: Dirk Schreckmann ]
 
reply
    Bookmark Topic Watch Topic
  • New Topic