This commit is contained in:
2021-01-27 22:49:31 +00:00
parent 9ea9bc9b89
commit 829f225c21
6 changed files with 128 additions and 136 deletions

View File

@@ -1,5 +1,4 @@
using System.Collections.Generic;
using Newtonsoft.Json.Linq;
using AyaNova.Biz;
namespace AyaNova.DataList
{
@@ -12,56 +11,46 @@ 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 = "widgetname";
dlistView.Add(cm);
// dynamic cm = new JObject();
// cm.fld = "widgetname";
// dlistView.Add(cm);
cm = new JObject();
cm.fld = "widgetserial";
dlistView.Add(cm);
// cm = new JObject();
// cm.fld = "widgetserial";
// dlistView.Add(cm);
cm = new JObject();
cm.fld = "widgetdollaramount";
dlistView.Add(cm);
// cm = new JObject();
// cm.fld = "widgetdollaramount";
// dlistView.Add(cm);
cm = new JObject();
cm.fld = "widgetusertype";
dlistView.Add(cm);
// cm = new JObject();
// cm.fld = "widgetusertype";
// dlistView.Add(cm);
cm = new JObject();
cm.fld = "widgetstartdate";
dlistView.Add(cm);
// cm = new JObject();
// cm.fld = "widgetstartdate";
// dlistView.Add(cm);
cm = new JObject();
cm.fld = "widgetactive";
dlistView.Add(cm);
// cm = new JObject();
// cm.fld = "widgetactive";
// dlistView.Add(cm);
cm = new JObject();
cm.fld = "username";
dlistView.Add(cm);
// cm = new JObject();
// cm.fld = "username";
// dlistView.Add(cm);
DefaultListView = dlistView.ToString(Newtonsoft.Json.Formatting.None);
// DefaultListView = dlistView.ToString(Newtonsoft.Json.Formatting.None);
DefaultColumns=""
// DefaultColumns=""
DefaultColumns = new List<string>() { "widgetname", "widgetserial", "widgetdollaramount", "widgetusertype", "widgetstartdate", "widgetactive", "username" };
DefaultSortBy = new Dictionary<string, string>() { { "widgetname", "+" } };
// DefaultDataListView = @"
// {
// [{key:""COLUMN UNIQUE KEY ID",sort:"-" or "+",filter:{any:true/false,items:[{FILTER OBJECT SEE BELOW}]} }, {key:"second column unique key"},{...etc...}]
// ""full"":[""widgetname"",""widgetserial"",""widgetdollaramount"",""widgetusertype"",""widgetstartdate"",""widgetactive"",""username""],
// }
// ";
//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
FieldDefinitions = new List<AyaDataListFieldDefinition>();
//DEPRECATED: FieldDefinitions.Add(new AyaDataListFieldDefinition { FieldKey = "df", AyaObjectType = (int)AyaType.Widget, SqlIdColumnName = "awidget.id", IsFilterable = false, IsSortable = false, });
FieldDefinitions.Add(new AyaDataListFieldDefinition
{
TKey = "WidgetName",