public string CssClassForArrowDirection(string sortByThisField) { string sortedByHeaderClassName = "das-table__sort"; if (!string.IsNullOrWhiteSpace(CurrentlySortedByField) && CurrentlySortedByField.ToLower() == sortByThisField.ToLower()) { sortedByHeaderClassName += ReverseSort ? " das-table__sort--desc" : " das-table__sort--asc"; } return(sortedByHeaderClassName); }
public Dictionary <string, string> BuildSortRouteData(string sortByThisField) { var routeData = new Dictionary <string, string>(); var reverseSort = !string.IsNullOrEmpty(CurrentlySortedByField) && CurrentlySortedByField.ToLower() == sortByThisField.ToLower() && !ReverseSort; routeData.Add(nameof(ReverseSort), reverseSort.ToString()); routeData.Add("SortField", sortByThisField); routeData.Add(nameof(SearchTerm), SearchTerm); return(routeData); }