Server side sorting changes the OrderBy
Server side sorting changes the OrderBy
rnachiappan
Posts: 2Questions: 2Answers: 0
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();
}
This discussion has been closed.
Answers
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