From f90eb44130b5118c18ff0211243767675ac3e2d6 Mon Sep 17 00:00:00 2001 From: John Cardinal Date: Wed, 15 Jan 2020 21:39:05 +0000 Subject: [PATCH] --- devdocs/specs/core-main-grids.txt | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/devdocs/specs/core-main-grids.txt b/devdocs/specs/core-main-grids.txt index 0a9ada0f..75d68ff4 100644 --- a/devdocs/specs/core-main-grids.txt +++ b/devdocs/specs/core-main-grids.txt @@ -23,7 +23,18 @@ Client - Client receives two field list back (id and display field), displays the single field - in large mode - the client sends no mini= parameter as it's optional and understood to be full size - - the list comes back as an object with not only the actual columns but also a separate property listing the set of columns in order to be displayed + + - DATA the data object in the return contains the list of row objects + - Each row contains a bunch of row objects + - Each column from the db is converted to an object and is formatted like this: + - {v:[field value],id:42[optional id value if openable]}, {v:[field value],id:42[optional id value if openable]}...etc + - First row object is ALWAYS the Default object + - Key: "_df_" FIRST COLUMN: the DATA list returned MUST contain as the first column a column labelled "_df_" column which is not intended for display + - Default column contains the same format as a normal column but doesn't display and is intended for the client to know what type and ID of object to open + - This is necessary in cases where they have made selections that preclude knowing what link to open, so if there is no links in the row this is the default for the entire row + - This also saves bandwidth as a list that has no other types can not bother setting the type or id for any other columns + + - COLUMNS the list comes back as an object with not only the actual columns but also a separate property listing the set of columns in order to be displayed - Also their data type - Also need what type of object if openable with an url - Client expects an arbitrary set of columns in an arbitrary order defined by server so doesn't have a pre-ordained set of things. @@ -40,7 +51,7 @@ Server - The server needs to tell the client which columns are coming back with the list and what types etc so the client can just adapt to any template setting - column list has type of object behind each column if applicable and user has rights to open so client can make hyperlinks - SERVER SENDS DATA - - Data in a standard for all grid lists json format, not based on set objects (I think I can do that, probably a hybrid object with JSON data) + - Data in a standard format all grid lists json format, not based on set objects (I think I can do that, probably a hybrid object with JSON data) - 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) @@ -50,7 +61,7 @@ Server - For example (wide list): data:{ 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.... ]} + rows:{[ {},{v:"Green mechanics",id:32},"...notes...",{v:"42",id:42}, ...thousands more etc.... ]} } - For example (XS list) data:{