This project is read-only.

SortInitialDirection issue

Mar 18, 2014 at 2:45 AM
when SortInitialDirection is set on last column of the grid, click other column to sort ,the arrow on the last column does not disappear.
for example:
@Html.Grid(@Model).Columns(columns =>
{
columns.Add(ove => ove.name).Sortable(true);
columns.Add(ove => ove.browse).Sortable(true);
columns.Add(ove => ove.download).Sortable(true).SortInitialDirection(GridSortDirection.Ascending);
}).WithPaging(20)

If SortInitialDirection is set to ove.name or ove.browse ,everything is ok
Mar 22, 2014 at 11:26 AM
Hi can you provide sample app to reproduce the problem?
Apr 18, 2014 at 3:01 AM
I see the same. Further more, it doesn't change the URL for the sort-order when I try to reverse it.

Adding a hidden column in the end solves the problem for me.
    columns.Add(ticket => ticket.CreatedTime)
        .Titled("Created")
        .Sortable(true)
        .Filterable(true)
        .Css("visible-lg")
        .RenderValueAs(t => t.CreatedTime.UtcDateTime.Humanize());
    columns.Add(ticket => ticket.UpdatedTime)
        .Titled("Last Activity")
        .Sortable(true)
        .Filterable(true)
        .Css("visible-lg")
        .SortInitialDirection(GridSortDirection.Ascending)
        .RenderValueAs(t => t.UpdatedTime.UtcDateTime.Humanize());
    columns.Add(true).RenderValueAs(ticket => "");
Apr 26, 2014 at 6:36 AM