The CSS and JavaScript below is designed to be added to your application's
stylesheet and script files. The displaytag only ships with a .tld and .jar -
maybe I'll include a .css and .js in the future, but don't count on it ;0)
Matt
> Hi Matt,
> I'm also looking for this type of sort indicator, I'm new to this
> display tag library, I could not see ant style sheet in display.jar,
> where exactly I need to add this code, please can you help me out?
>
> Thanks in advance,
> Anand
>
> Matt Raible <[EMAIL PROTECTED]> wrote:
> > First of all, I would like to congratulate the developers. This display
> > tag is great.
> > I am building a table using the library that allows users to sort
> > columns. I would like to indicate which column is currently being
> > sorted and in which direction by displaying an arrow next to the column
> > title like Hotmail, Yahoo Mail, etc.
>
> > How can I accomplish this with the Display Tag Library?
>
> This is currently not a feature in the tag, but I whipped up a little
> JavaScript and CSS to make this possible:
>
> CSS
> ---------
>
> th.sorted {
> background: #A9A9A9 !important;
> color: #000000 !important;
> cursor: pointer !important; /* IE 5.5 non-compliant workaround */
> cursor: hand !important;
> padding-left: 3px;
> }
>
> img.sortIndicator {
> margin-left: 3px;
> }
>
> JavaScript
> ------------
> function addSortIndicator() {
> var table = document.getElementsByTagName("table")[0];
> var cols = table.getElementsByTagName("th");
> var sort = "";
> var order = "";
> // my own little hack to set the right name for the image
> if (order == "dec") {
> order = "desc";
> }
> if (sort == "") {
> setIndicator(cols[3], "desc"); // 4th column is sorted in query
> } else {
> setIndicator(cols[sort], order);
> }
> }
>
> window.onload=addSortIndicator;
>
> function setIndicator(e, order) {
> e.className = "sorted";
> var indicator = document.createElement("img");
> indicator.setAttribute("src",
> "/images/"+order+".gif");
> indicator.setAttribute("width", "9");
> indicator.setAttribute("height", "10");
> indicator.setAttribute("alt", (order == "asc") ? "Ascending" :
> "Descending"); indicator.className = "sortIndicator";
> e.appendChild(indicator); }
>
> You can download the images I used from:
>
> http://raibledesigns.com/demos/images/
>
> This works great for me - thanks for the idea!
>
> Matt
>
> -------------------------------------------------------
> This SF.net email is sponsored by: Etnus, makers of TotalView, The best
> thread debugger on the planet. Designed with thread debugging
> features you've never dreamed of, try TotalView 6 free at www.etnus.com.
> _______________________________________________
> displaytag-user mailing list
> [EMAIL PROTECTED]
> https://lists.sourceforge.net/lists/listinfo/displaytag-user
>
> ---------------------------------
> Do you Yahoo!?
> Free online calendar with sync to Outlook(TM).
-- Matt Raible, Raible Designs, Morrison CO US
-- Tel: +1 303 979-5340
-- Mob: +1 720 560-8460
-- Fax: +1 508 256-6471
-- Web: http://www.raibledesigns.com
-------------------------------------------------------
This SF.net email is sponsored by: Etnus, makers of TotalView, The best
thread debugger on the planet. Designed with thread debugging features
you've never dreamed of, try TotalView 6 free at www.etnus.com.
_______________________________________________
displaytag-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/displaytag-user