This commit is contained in:
2
.vscode/launch.json
vendored
2
.vscode/launch.json
vendored
@@ -53,7 +53,7 @@
|
||||
"AYANOVA_FOLDER_USER_FILES": "c:\\temp\\RavenTestData\\userfiles",
|
||||
"AYANOVA_FOLDER_BACKUP_FILES": "c:\\temp\\RavenTestData\\backupfiles",
|
||||
"AYANOVA_FOLDER_TEMPORARY_SERVER_FILES": "c:\\temp\\RavenTestData\\tempfiles",
|
||||
"AYANOVA_SERVER_TEST_MODE": "true",
|
||||
"AYANOVA_SERVER_TEST_MODE": "false",
|
||||
"AYANOVA_SERVER_TEST_MODE_SEEDLEVEL": "small",
|
||||
"AYANOVA_SERVER_TEST_MODE_TZ_OFFSET": "-7",
|
||||
"AYANOVA_BACKUP_PG_DUMP_PATH": "C:\\data\\code\\postgres_13\\bin\\"
|
||||
|
||||
@@ -42,14 +42,33 @@ namespace AyaNova.DataList
|
||||
//set defaults if not provided in listOptions
|
||||
public void SetListOptionDefaultsIfNecessary(DataListBase listOptions)
|
||||
{
|
||||
//columns, filter and sortby could all be null
|
||||
if (listOptions.Filter == null)
|
||||
listOptions.Filter = new List<DataListFilterOption>();
|
||||
|
||||
if (listOptions.SortBy == null)
|
||||
listOptions.SortBy = new Dictionary<string, string>();
|
||||
|
||||
//Check Columns
|
||||
if (listOptions is DataListTableOptions)
|
||||
{//if this doesn't work then just ditch this method in favor of local code, it's not really saving much
|
||||
if (((DataListTableOptions)listOptions).Columns.Count == 0)
|
||||
((DataListTableOptions)listOptions).Columns = DefaultColumns;
|
||||
{
|
||||
var dlto = ((DataListTableOptions)listOptions);
|
||||
if (dlto.Columns == null)
|
||||
dlto.Columns = new List<string>();
|
||||
//if this doesn't work then just ditch this method in favor of local code, it's not really saving much
|
||||
if (dlto.Columns.Count == 0)
|
||||
dlto.Columns = DefaultColumns;
|
||||
}
|
||||
|
||||
//Check SortBy
|
||||
if (listOptions.SortBy.Count == 0)
|
||||
listOptions.SortBy = DefaultSortBy;
|
||||
|
||||
//Check filter
|
||||
if (listOptions.Filter == null)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -36,7 +36,7 @@ namespace AyaNova.DataList
|
||||
|
||||
|
||||
//STATIC filter options from server
|
||||
List<DataListFilterOption> StaticServerFilterOptions = null;
|
||||
List<DataListFilterOption> StaticServerFilterOptions = new List<DataListFilterOption>();
|
||||
if (DataList is IAyaDataListServerCriteria)
|
||||
StaticServerFilterOptions = ((IAyaDataListServerCriteria)DataList).DataListServerCriteria(userId, userRoles, dataListTableOptions);
|
||||
|
||||
|
||||
@@ -9,6 +9,12 @@ namespace AyaNova.Models
|
||||
public Dictionary<string, string> SortBy { get; set; }
|
||||
public List<DataListFilterOption> Filter { get; set; }
|
||||
public string ClientCriteria { get; set; }
|
||||
|
||||
public DataListBase()
|
||||
{
|
||||
SortBy = new Dictionary<string, string>();
|
||||
Filter = new List<DataListFilterOption>();
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
Reference in New Issue
Block a user