From ea9fd9d249b090dd2131f1f3b68b618ce82ee9d6 Mon Sep 17 00:00:00 2001 From: John Cardinal Date: Wed, 15 Jan 2020 15:12:29 +0000 Subject: [PATCH] --- devdocs/specs/core-main-grids.txt | 7 +++++-- server/AyaNova/biz/WidgetBiz.cs | 4 ++-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/devdocs/specs/core-main-grids.txt b/devdocs/specs/core-main-grids.txt index 6a4bc6df..7411a157 100644 --- a/devdocs/specs/core-main-grids.txt +++ b/devdocs/specs/core-main-grids.txt @@ -44,14 +44,17 @@ Server - Each row has each column as a object comprising of: - Display value (the data to show, not formatted yet, that's up to the client) - Optional: ID value (if the object is openable **** MUST CHECK RIGHTS ALSO HERE **** then this is the id to open for the client to put a hyperlink on that column) + - To save bandwidth abbreviations are used in the column definitions: + - ColumnsJSON=@"{[ {""cm"":""Widget"",""dt"":""text"",""ay"":"+ AyaType.Widget.ToString()+ "}]}"; + - 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:{[ {name:"lt_client_name",datatype:text,ayatype:client},{name:"lt_client_notes",datatype:text},{name:"lt_last_workorder",datatype:number,ayatype:workorder}]} + columns:{[ {cm:"lt_client_name",dt:text,ay:client},{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) data:{ - columns:{[ {name:"lt_client",datatype:text,ayatype:client}]} + columns:{[ {cm:"lt_client",dt:text,ay:client}]} rows:{ {display:"Green mechanics",id:32}, ...thousands more etc.... } } diff --git a/server/AyaNova/biz/WidgetBiz.cs b/server/AyaNova/biz/WidgetBiz.cs index 9dbaeb15..dce1c7dc 100644 --- a/server/AyaNova/biz/WidgetBiz.cs +++ b/server/AyaNova/biz/WidgetBiz.cs @@ -331,9 +331,9 @@ namespace AyaNova.Biz //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 + //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 - ColumnsJSON=@"{[ {""nm"":""lt_client"",""dt"":""text"",""at"":""client""}]}"; + ColumnsJSON=@"{[ {""cm"":""Widget"",""dt"":""text"",""ay"":"+ AyaType.Widget.ToString()+ "}]}"; }else{ }