This commit is contained in:
@@ -15,6 +15,7 @@ namespace AyaNova.Models
|
||||
internal const int DefaultLimit = 25;
|
||||
internal int? Offset { get; set; }
|
||||
internal int? Limit { get; set; }
|
||||
internal List<string> HiddenAffectiveColumns { get; set; }
|
||||
|
||||
internal DataListTableProcessingOptions(
|
||||
DataListTableRequest request,
|
||||
@@ -51,6 +52,8 @@ namespace AyaNova.Models
|
||||
foreach (DataListFilterOption dfo in StaticServerFilterOptions)
|
||||
base.Filter.Add(dfo);
|
||||
|
||||
SetHiddenAffectiveColumns(dataList);
|
||||
|
||||
}
|
||||
|
||||
internal List<string> AllUniqueColumnKeysReferenced
|
||||
@@ -62,5 +65,43 @@ namespace AyaNova.Models
|
||||
}
|
||||
}
|
||||
|
||||
//All columns that are hidden but are affecting the query (sorting, filtering)
|
||||
//so in UI can show that there are hidden columns affecting the result set
|
||||
internal void SetHiddenAffectiveColumns(IDataListProcessing dataList)
|
||||
{
|
||||
|
||||
List<string> tempKeys = new List<string>();
|
||||
foreach (string s in base.Filter.Select(z => z.Column).ToList())
|
||||
{
|
||||
if (!Columns.Contains(s))
|
||||
{
|
||||
if (!tempKeys.Contains(s))
|
||||
{
|
||||
tempKeys.Add(s);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
foreach (string s in base.SortBy.Select(z => z.Key).ToList())
|
||||
{
|
||||
if (!Columns.Contains(s))
|
||||
{
|
||||
if (!tempKeys.Contains(s))
|
||||
{
|
||||
tempKeys.Add(s);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
foreach (string s in tempKeys)
|
||||
{
|
||||
var fd = dataList.FieldDefinitions.Where(z => z.FieldKey == s).FirstOrDefault();
|
||||
if (fd != null)
|
||||
HiddenAffectiveColumns.Add(fd.TKey);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user