This commit is contained in:
2020-01-23 16:54:20 +00:00
parent a3a62dd55a
commit 93de4d5112

View File

@@ -17,7 +17,14 @@ namespace AyaNova.DataList
if (string.IsNullOrWhiteSpace(dataFilter.Sort)) if (string.IsNullOrWhiteSpace(dataFilter.Sort))
{ {
return string.Empty;//used to be default order by //sort by default field descending which should in theory always be the id column of the main object in the list
//which should return the results to user with most recent records at the top if no sort order was specified
if(objectFieldsList[0].FieldKey=="df"){
return $"ORDER BY {objectFieldsList[0].SqlIdColumnName} DESC";
}else{
//no default column so no idea how to sort
return string.Empty;
}
} }
StringBuilder sb = new StringBuilder(); StringBuilder sb = new StringBuilder();