Details

    • Type: New Feature New Feature
    • Status: Closed Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.0
    • Fix Version/s: 1.1
    • Component/s: Paging/Sorting
    • Labels:
      None

      Description

      When user clicks on a sortable column that is NOT currently sorted, the sort order is always ascending. My project needs to have different default sort order per column.


      Related to http://jira.codehaus.org/browse/DISPL-39

        Activity

        Hide
        Matt Raible added a comment -
        You should be able to use the "defaultorder" attribute to accomplish this.

        http://displaytag.sourceforge.net/tagreference-displaytag-12.html
        Show
        Matt Raible added a comment - You should be able to use the "defaultorder" attribute to accomplish this. http://displaytag.sourceforge.net/tagreference-displaytag-12.html
        Hide
        Dick Zetterberg added a comment -
        The defaultorder can only be specified on the table tag, not on the column tag.
        If you specify it now (on the table) it only seems to affect the original sorting that you might have defined with defaultsort.
        I agree with the original reporter that you should be able to specify defaultorder per column.
        Show
        Dick Zetterberg added a comment - The defaultorder can only be specified on the table tag, not on the column tag. If you specify it now (on the table) it only seems to affect the original sorting that you might have defined with defaultsort. I agree with the original reporter that you should be able to specify defaultorder per column.
        Hide
        added a comment -
        I've send a Diff file to Matt with this feature.
        Show
        added a comment - I've send a Diff file to Matt with this feature.
        Hide
        Ling Thio added a comment -
        It would be great if it would work like this:
            <display:table name="command" defaultorder="ascending">
                <display:column property="feature" title="Feature" />
                <display:column property="popularity" title="Popularity" defaultorder="descending" />
            </display:table>

        Clicking on name would sort it by name in ascending order (table defaultorder since it was not specified in column).
        Clicking on name again would sort it by name in descending order.

        Clicking on votes would sort it by votes in descending order (column defaultorder).
        Clicking on votes again would sort it by votes in ascending order.
        Show
        Ling Thio added a comment - It would be great if it would work like this:     <display:table name="command" defaultorder="ascending">         <display:column property="feature" title="Feature" />         <display:column property="popularity" title="Popularity" defaultorder="descending" />     </display:table> Clicking on name would sort it by name in ascending order (table defaultorder since it was not specified in column). Clicking on name again would sort it by name in descending order. Clicking on votes would sort it by votes in descending order (column defaultorder). Clicking on votes again would sort it by votes in ascending order.
        Hide
        Matt Raible added a comment -
        Here is the diff that was sent to me. I can commit it once proper unit tests are contributed with it. We'd like to keep high test coverage for this project.
        Show
        Matt Raible added a comment - Here is the diff that was sent to me. I can commit it once proper unit tests are contributed with it. We'd like to keep high test coverage for this project.
        Hide
        Lili added a comment -
        This feature would be very useful to us too. Currently our users have to click twice on the same columns to get the desired sort order. For example it would be very useful to have the column "Product Cost" sort by default in descending order and the column "Product Name" sort by default in ascending order.

        Show
        Lili added a comment - This feature would be very useful to us too. Currently our users have to click twice on the same columns to get the desired sort order. For example it would be very useful to have the column "Product Cost" sort by default in descending order and the column "Product Name" sort by default in ascending order.
        Hide
        fabrizio giustina added a comment -
        patch committed. dummy test case added, will close the issue only when the test case will be working
        Show
        fabrizio giustina added a comment - patch committed. dummy test case added, will close the issue only when the test case will be working
        Hide
        fabrizio giustina added a comment -
        testcase completed, feature will be available in 1.1
        Show
        fabrizio giustina added a comment - testcase completed, feature will be available in 1.1
        Hide
        dhinesh added a comment -
        can u please tell me how to sort the particular column or all columns in a descending order at first click instead of ascending order in first click
        Show
        dhinesh added a comment - can u please tell me how to sort the particular column or all columns in a descending order at first click instead of ascending order in first click

          People

          • Reporter:
            Brian Guan
          • Votes:
            6 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: