From e908c2d5f717e990fca85391d7624a1b95b3566d Mon Sep 17 00:00:00 2001 From: John Cardinal Date: Wed, 15 Jan 2020 00:55:19 +0000 Subject: [PATCH] --- devdocs/specs/core-main-grids.txt | 6 +++--- server/AyaNova/biz/WidgetBiz.cs | 26 +++++++++++++------------- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/devdocs/specs/core-main-grids.txt b/devdocs/specs/core-main-grids.txt index 437d4048..6a4bc6df 100644 --- a/devdocs/specs/core-main-grids.txt +++ b/devdocs/specs/core-main-grids.txt @@ -46,12 +46,12 @@ Server - 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) - 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}} - rows:{ {display:"Green mechanics",id:32},"...notes...",{display:"42",id:42}, ...thousands more etc.... } + columns:{[ {name:"lt_client_name",datatype:text,ayatype:client},{name:"lt_client_notes",datatype:text},{name:"lt_last_workorder",datatype:number,ayatype: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:{[ {name:"lt_client",datatype:text,ayatype: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 92537fa7..9dbaeb15 100644 --- a/server/AyaNova/biz/WidgetBiz.cs +++ b/server/AyaNova/biz/WidgetBiz.cs @@ -318,25 +318,25 @@ namespace AyaNova.Biz //BUILD THE RETURN BASED ON TEMPLATE and MINI CONDITIONAL FORMAT - //TODO: Get template (MOCKED FOR NOW UNTIL PROOF OF CONCEPT) - /*{ "MyStringArray" : ["somestring1", "somestring2"] } - { - columns:[ -ltKey,ltKey2,ltkey3 - ], - mini:[ - ltKey, ltkey2, ltkey3 - ] -} - */ - var MOCK_DISPLAY_TEMPLATE = @" + //TODO: Get template (MOCKED FOR NOW UNTIL PROOF OF CONCEPT) + var MOCK_WIDGET_DISPLAY_TEMPLATE_JSON = @" { ""full"":[""WidgetName"",""WidgetSerial"",""WidgetDollarAmount"",""WidgetRoles"",""WidgetStartDate"",""Active""], ""mini"":[""WidgetName"",""WidgetSerial""] } "; - //TODO: BUILD THE RETURN LIST OF FIELDS / TYPES AND ORDER FROM TEMPLATE AND MINI CONDITIONAL + //TODO: BUILD THE RETURN LIST OF FIELDS / TYPES AND ORDER FROM TEMPLATE AND MINI CONDITIONAL + //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 + ColumnsJSON=@"{[ {""nm"":""lt_client"",""dt"":""text"",""at"":""client""}]}"; + }else{ + + } //TODO: BUILD THE RETURN LIST OF DATA ITEMS //If mini format all desired columns in order into the single mini return display (and set the only other return field which is ID)