This commit is contained in:
2020-02-13 23:32:20 +00:00
parent aa0cfd2e13
commit 3d1f3f8fd9
3 changed files with 80 additions and 42 deletions

View File

@@ -1,4 +1,5 @@
using System.Collections.Generic;
using Newtonsoft.Json.Linq;
using AyaNova.Biz;
namespace AyaNova.DataList
{
@@ -15,17 +16,31 @@ namespace AyaNova.DataList
public TestWidgetUserEmailDataList()
{
ListKey = nameof(TestWidgetUserEmailDataList);
SQLFrom = "from awidget left outer join auser on (awidget.userid=auser.id) left outer join auseroptions on (auser.id=auseroptions.userid)";
FullListAllowedRoles = BizRoles.GetRoleSet(DefaultListObjectType).ReadFullRecord;
MiniListAllowedRoles = AuthorizationRoles.AllExceptCustomers;//anyone but clients who shouldn't see users email addresses (so can select on forms)
AllowedRoles = BizRoles.GetRoleSet(DefaultListObjectType).ReadFullRecord;
DefaultListObjectType = AyaType.Widget;
DefaultDataListDisplayTemplate = @"
{
""full"":[""widgetname"",""username"",""emailaddress"",""widgetactive""],
""mini"":[""widgetname"",""username"",""emailaddress""]
}
";
//Default ListView
dynamic dlistView = new JArray();
dynamic cm = new JObject();
cm.fld = "widgetname";
dlistView.Add(cm);
cm = new JObject();
cm.fld = "username";
dlistView.Add(cm);
cm = new JObject();
cm.fld = "emailaddress";
dlistView.Add(cm);
cm = new JObject();
cm.fld = "widgetactive";
dlistView.Add(cm);
DefaultListView = dlistView.ToString();
//NOTE: First field after df is used as the title above the narrow grid view so it should be the name of the item to be shown that is most identifiable
FieldDefinitions = new List<AyaDataListFieldDefinition>();