Menu

Client-side Sorting

Help
Mike Traum
2005-10-12
2012-10-09
  • Mike Traum

    Mike Traum - 2005-10-12

    I see nowhere that displaytag does client-side sorting, correct?

    If not, does anyone have any solutions? I saw a reference to this method (sorting with the DOM):
    http://raibledesigns.com/page/rd?anchor=client_side_sorting_with_the

    But, this will not properly sort data types such as Dates, and adding a date parser / comparator to the javascript, especially if your using i18n, is no small task.

    Any ideas?

    Thanks,
    Mike

     
    • Jorge L. Barroso

      Check out the displaytag example at the AjaxTags project, http://ajaxtags.no-ip.info/ . It's a compromise between pure client-side sorting and refreshing the entire page just to sort. It sends an ajax request to the server to have displaytag do the sorting, and refreshes the div containing the table with the response, not the entire page.

      -Jorge

       
      • Mike Traum

        Mike Traum - 2005-10-12

        Thanks for the response. But, what I really need is client side sorting to reduce the load on the server.

        Any ideas?

        Thanks,
        Mike

         
      • Jorge L. Barroso

        Here's the direct link.
        http://66.93.98.248:8080/ajaxtags/displaytag.jsp

        BTW, this example also shows "client-side" paging, since both displaytag's sorting and paging occur via ajax.

        -Jorge

         
        • mt_struts

          mt_struts - 2005-10-12

          GR8! Thanks for posting :-)

           
          • Jatin

            Jatin - 2007-01-10

            I cannot access both the page.. I have to use onlick function of javascriot in my display column tag.let me know hows tht possible preferably w/o ajax

             
    • Matt Raible

      Matt Raible - 2005-10-12

      I have a version of this that supports dates. I don't have it on me right now, but I don't think it was too hard to implement. I used it in an application where i18n wasn't an issue. I don't know if it'll handle multiple languages.

      Matt

       

Log in to post a comment.