Menu

Accessing state of displaytag

Help
jimpo
2005-01-04
2012-10-08
  • jimpo

    jimpo - 2005-01-04

    Is there any way to access the state of displaytag? Specifically, I would like to know which column the table is sorted by, and in which order.

    P.S. What I am trying to achieve is to have those "little triangles" that show which column is sorted in table headers appear right after the header text. With stylesheets I only know how to make them appear on the right side of the column, which leaves too much white space between the title text and the icon. If I can access the sorting state cleanly, I can prepare different title values based on the state.

    I see that tag uses d-28822-s=3 type of parameters to set the sorting, but I'd rather get the information in a better way than analyzing the auto-generated parameters (which may change in subsequent releases, etc).

     
    • fabrizio giustina

      you should be able to achieve the desired result using css only, I don't think that manually generating different title would be a clean solution.

      Try assigning the background arrow image to the link inside the column header

      table thead th.sorted a {
      background-image: ...;
      background-position: right;
      padding-right: 10px;
      ...
      }

       

Log in to post a comment.

MongoDB Logo MongoDB