Server side sorting changes the OrderBy

Server side sorting changes the OrderBy

rnachiappanrnachiappan Posts: 2Questions: 2Answers: 0
edited November 2014 in Free community support

I'm using DataTables and it works really well. I just have one problem. I'm getting all the workorders and ordering them by status but the Sorting code changes the orderby to ascending.

wo = WorkOrders.GetOpen()encyWideMessage().ToWorkOrders();
wo = wo.OrderByDescending(wf => wf.CodeWorkOrderStatus.Description == "Open").ToWorkOrders(); -- It orders the results correctly here

 //// Sorting 
 if (sortDirection == "asc")
 {
 wo = wo.OrderBy(orderingFunction).ToWorkOrders(); -- This line changes the sorting back to the default sorting
 }
 else
 {
 wo = wo.OrderByDescending(orderingFunction).ToWorkOrders();
 }

Answers

  • allanallan Posts: 63,523Questions: 1Answers: 10,473 Site admin

    I don't recognise that code I'm afraid. It isn't part of the DataTables distribution, so you might be best asking in a general programming forum for whatever language that is.

    Allan

This discussion has been closed.