This commit is contained in:
2020-01-15 15:27:06 +00:00
parent ea9fd9d249
commit fb87ddc312
2 changed files with 10 additions and 4 deletions

View File

@@ -144,6 +144,9 @@ namespace AyaNova.Biz
public string DataType { get; set; }
//If it's an enum DataType then this is the specific enum type which sb the name of the class that holds the enum in the server project
public string EnumType { get; set; }
//if field is a reference to another object (i.e. a client in a workorders list)
//then the type to open is set here
public int AyObjectType {get;set;}
public ObjectField()
@@ -155,6 +158,8 @@ namespace AyaNova.Biz
Filterable = true;
Sortable = true;
MiniAvailable = true;
//Set openable object type to no type which is the default and means it's not a link to another object
AyObjectType=(int)AyaType.NoType;
}
}

View File

@@ -326,16 +326,17 @@ namespace AyaNova.Biz
}
";
//TODO: BUILD THE RETURN LIST OF FIELDS / TYPES AND ORDER FROM TEMPLATE AND MINI CONDITIONAL
//TODO: BUILD THE COLUMNS RETURN PROPERTY JSON FRAGMENT
//for MINI format we just use a static column definition built in to this list object
//for FULL we build it from the template automatically
//eg: columns:{[ {name:"lt_client_name",datatype:text,ayatype:client},{name:"lt_client_notes",datatype:text},{name:"lt_last_workorder",datatype:number,ayatype:workorder}]}
//if FULL Pass the template to the ObjectFields which will build the return JSON for here and will also ensure the fields are correct, if any are unknown it will just ignore them but maybe log it?
string ColumnsJSON=string.Empty;
if(listOptions.Mini){
//NEXT: build this with AyaType templated in as a number to avoid magic numers
//and figure out if it's worth it to abbreviate the property names like this or just confusing for no useful purpose
//all mini lists will have an id so include the type to open
ColumnsJSON=@"{[ {""cm"":""Widget"",""dt"":""text"",""ay"":"+ AyaType.Widget.ToString()+ "}]}";
}else{
ColumnsJSON=@"{[ {""cm"":""Widget"",""dt"":""text"",""ay"":"+ AyaType.Widget.ToString()+ "}]}";
}
//TODO: BUILD THE RETURN LIST OF DATA ITEMS