This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
using System.Collections.Generic;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using AyaNova.Biz;
|
||||
namespace AyaNova.DataList
|
||||
{
|
||||
@@ -7,18 +8,52 @@ namespace AyaNova.DataList
|
||||
//No JOINS just straight up widgets
|
||||
public TestWidgetDataList()
|
||||
{
|
||||
ListKey = nameof(TestWidgetDataList);
|
||||
|
||||
DefaultListObjectType = AyaType.Widget;
|
||||
SQLFrom = "from awidget left outer join auser on (awidget.userid=auser.id)";
|
||||
FullListAllowedRoles = BizRoles.GetRoleSet(DefaultListObjectType).ReadFullRecord;
|
||||
MiniListAllowedRoles = AuthorizationRoles.All;//anyone (so can select on forms)
|
||||
AllowedRoles = BizRoles.GetRoleSet(DefaultListObjectType).ReadFullRecord;
|
||||
|
||||
DefaultDataListDisplayTemplate = @"
|
||||
{
|
||||
""full"":[""widgetname"",""widgetserial"",""widgetdollaramount"",""widgetusertype"",""widgetstartdate"",""widgetactive"",""username""],
|
||||
""mini"":[""widgetname"",""widgetserial""]
|
||||
}
|
||||
";
|
||||
//Default ListView
|
||||
dynamic dlistView = new JArray();
|
||||
dynamic cm=new JObject();
|
||||
cm.fld="widgetname";
|
||||
dlistView.Add(cm);
|
||||
cm=new JObject();
|
||||
cm.fld="widgetname";
|
||||
dlistView.Add(cm);
|
||||
|
||||
cm=new JObject();
|
||||
cm.fld="widgetname";
|
||||
dlistView.Add(cm);
|
||||
cm=new JObject();
|
||||
cm.fld="widgetname";
|
||||
dlistView.Add(cm);
|
||||
cm=new JObject();
|
||||
cm.fld="widgetname";
|
||||
dlistView.Add(cm);
|
||||
cm=new JObject();
|
||||
cm.fld="widgetname";
|
||||
dlistView.Add(cm);
|
||||
cm=new JObject();
|
||||
cm.fld="widgetname";
|
||||
dlistView.Add(cm);
|
||||
|
||||
// //name starts with filter to constrict to widgets that this test block created only
|
||||
// dynamic DataFilterNameStart = new JObject();
|
||||
// DataFilterNameStart.fld = "widgetname";
|
||||
// DataFilterNameStart.op = Util.OpStartsWith;
|
||||
// DataFilterNameStart.value = WidgetNameStart;
|
||||
// dfilter.Add(DataFilterNameStart);
|
||||
|
||||
|
||||
// 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>();
|
||||
|
||||
Reference in New Issue
Block a user