This commit is contained in:
2020-01-15 16:56:40 +00:00
parent f845c396cf
commit cbe48027ae
3 changed files with 9 additions and 8 deletions

View File

@@ -49,7 +49,7 @@ Server
- cm=column name locale key, dt=AyDataType, ay=AyaType to open on click of that column field (optional, not present if not openable)
- For example (wide list):
data:{
columns:{[ {cm:"lt_client_name",dt:text,ay:client},{cm:"lt_client_notes",dt:text},{cm:"lt_last_workorder",dt:number,ay:workorder}]}
columns:{[ {cm:"lt_client_name",dt:text,ay:2},{cm:"lt_client_notes",dt:text},{cm:"lt_last_workorder",dt:number,ay:workorder}]}
rows:{[ {display:"Green mechanics",id:32},"...notes...",{display:"42",id:42}, ...thousands more etc.... ]}
}
- For example (XS list)

View File

@@ -19,7 +19,10 @@ CURRENT MASTER PLAN IN CLIENT TODO
REALLY MAKING MORE PROGRESS WHEN CLIENT DEV DRIVES BACKEND DEV, STICK TO THAT!!
-----------------------
DATATYPE: should this be an enum rather than text because text takes up a lot of space bandwidth wise and is inefficient and also an enum can allow compiler type enforcement to avoid typos etc
GRID LISTS TODO NOW:
- RECODE GETLIST in WidgetBiz
- Return JSON and internally work with JSON so the list can return dynamic object
- https://devblogs.microsoft.com/dotnet/try-the-new-system-text-json-apis/

View File

@@ -145,11 +145,9 @@ namespace AyaNova.Biz
var fullFields = ((JArray)jtemplate["full"]).ToObject<string[]>();
//Generate JSON fragment to return with column definitions
StringBuilder sb=new StringBuilder();
// StringWriter sw = new StringWriter();
// JsonTextWriter writer = new JsonTextWriter(sw);
// writer.WriteStartObject();//{
// ColumnsJSON=@"""columns"":[ {""cm"":""Widget"",""dt"":""text"",""ay"":"+ AyaType.Widget.ToString()+ "},{..etc..}]";
StringBuilder sb = new StringBuilder();
// ColumnsJSON=@"""columns"":[ {""cm"":""Widget"",""dt"":""text"",""ay"":"+ AyaType.Widget.ToString()+ "},{..etc..}]";
sb.Append("\"columns\":[");
foreach (string s in fullFields)
{
@@ -161,14 +159,14 @@ namespace AyaNova.Biz
sb.Append($"\"cm\":\"{o.Key}\",\"dt\":\"{o.DataType}\"");
//Has a AyObjectType (linkable / openable?)
if(o.AyObjectType!=0)
if (o.AyObjectType != 0)
sb.Append($",\"ay\":{o.AyObjectType}");
sb.Append("}");
}
}
sb.Append("]");
// writer.WriteEndObject();//}
return sb.ToString();
}