From 05877d0a3eab8561cb75e67b33ac312282badada Mon Sep 17 00:00:00 2001 From: John Cardinal Date: Wed, 27 Jan 2021 20:01:14 +0000 Subject: [PATCH] --- server/AyaNova/DataList/AttachmentDataList.cs | 46 +++++++++---------- server/AyaNova/DataList/AyaDataList.cs | 12 +++-- 2 files changed, 30 insertions(+), 28 deletions(-) diff --git a/server/AyaNova/DataList/AttachmentDataList.cs b/server/AyaNova/DataList/AttachmentDataList.cs index 4541a87f..f7609eca 100644 --- a/server/AyaNova/DataList/AttachmentDataList.cs +++ b/server/AyaNova/DataList/AttachmentDataList.cs @@ -1,5 +1,4 @@ using System.Collections.Generic; -using Newtonsoft.Json.Linq; using AyaNova.Biz; namespace AyaNova.DataList { @@ -13,34 +12,35 @@ namespace AyaNova.DataList var RoleSet = BizRoles.GetRoleSet(DefaultListObjectType); AllowedRoles = RoleSet.ReadFullRecord | RoleSet.Change; - //Default ListView - dynamic dlistView = new JArray(); + // //Default ListView + // dynamic dlistView = new JArray(); - dynamic cm = new JObject(); - cm.fld = "displayfilename"; - cm.sort = "+"; - dlistView.Add(cm); + // dynamic cm = new JObject(); + // cm.fld = "displayfilename"; + // cm.sort = "+"; + // dlistView.Add(cm); - cm = new JObject(); - cm.fld = "object"; - dlistView.Add(cm); + // cm = new JObject(); + // cm.fld = "object"; + // dlistView.Add(cm); - cm = new JObject(); - cm.fld = "size"; - cm.sort = "-"; - dlistView.Add(cm); + // cm = new JObject(); + // cm.fld = "size"; + // cm.sort = "-"; + // dlistView.Add(cm); - cm = new JObject(); - cm.fld = "notes"; - dlistView.Add(cm); + // cm = new JObject(); + // cm.fld = "notes"; + // dlistView.Add(cm); - cm = new JObject(); - cm.fld = "exists"; - dlistView.Add(cm); + // cm = new JObject(); + // cm.fld = "exists"; + // dlistView.Add(cm); + // DefaultListView = dlistView.ToString(Newtonsoft.Json.Formatting.None); - DefaultListView = dlistView.ToString(Newtonsoft.Json.Formatting.None); - + DefaultColumns = new List() { "displayfilename", "object", "size", "notes", "exists" }; + DefaultSortBy = new Dictionary() { { "displayfilename", "+" }, { "size", "-" } }; //NOTE: Due to the join, all the sql id and name fields that can conflict with the joined (in this case User) table need to be specified completely @@ -94,6 +94,6 @@ namespace AyaNova.DataList } - + }//eoc }//eons \ No newline at end of file diff --git a/server/AyaNova/DataList/AyaDataList.cs b/server/AyaNova/DataList/AyaDataList.cs index c32c81ba..2fac1227 100644 --- a/server/AyaNova/DataList/AyaDataList.cs +++ b/server/AyaNova/DataList/AyaDataList.cs @@ -18,7 +18,8 @@ namespace AyaNova.DataList //well, not here exactly but add a new DATALIST class if it will be displayed as a list anywhere in the UI or reported on public AyaDataList() { - + // DefaultColumns = new List(); + // DefaultSortBy = new Dictionary(); } public string SQLFrom { get; set; } @@ -36,11 +37,12 @@ namespace AyaNova.DataList //set defaults if not provided in listOptions public void SetListOptionDefaultsIfNecessary(DataListBase listOptions) { - 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; + 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; } - + if (listOptions.SortBy.Count == 0) listOptions.SortBy = DefaultSortBy; }