This commit is contained in:
2020-02-13 18:49:39 +00:00
parent 8d2c57e702
commit c141c562b7
2 changed files with 123 additions and 1 deletions

View File

@@ -1,5 +1,17 @@
DISPLAY FORMAT TEMPLATE SYSTEM SPECS
************** DEPRECATED EVERYTHING BELOW **********************************
OVERVIEW
RAVEN uses a user customizable template to determine what fields in which order get sent to the client when they display a list or select from a drop down
- FILTER / SORT: The templating is ENTIRELY separate from the filtering and sorting code which is already coded sufficiently and is a separate thing

View File

@@ -1,4 +1,114 @@
LIST / GRAPH FILTERING SORTING AND PAGING
LIST / GRAPH FILTERING SORTING AND COLUMN RETURNED
DataListView objects are used to filter and sort and determine display order and presence of columns returned by:
DataTables (was grids in v7)
Reports
Select boxes (on forms like selecting a part or a client)
When the DataList route is hit it's used to get all of the above types of data.
A dataListView JSON string is sent with the request in order to have the server sort/filter/return
There is a default PickList format and a default DataTable format pre-defined and hard coded at the server with each dataList definition object
If the client isn't using a particular dataListView it MUST send the DataListView json as one of the following:
{default:"PickList"} or {default:"DataTable"}
This will instruct the server to use the pre-defined format instead
JSON DataListView format:
ONE string of json, not separate
Contains all columns that are relevant each as an object with various props desired to be returned in order
If a column isn't filtered or sorted or included then it isn't in the collection
Order and presence determines sort, filter, return and display order
Each column object contains it's sorted, sort order and filters collection which can be empty
Sort and filter properties are optional and can be omitted
"any" property is optional in a filter and can be omitted
UI: shows all available columns, user sets order by re-arranging and whether to include or not with a checkbox Include which defaults to true if there is any conditions on that column
Example:
DataListView JSON:
[{key:"COLUMN UNIQUE KEY ID",sort:"-" or "+",filter:{any:true/false,items:[{FILTER OBJECT SEE BELOW}]} }, {key:"second column unique key"},{...etc...}]
Filter object definition:
Has an "any" boolean property which if true means make an OR query of the conditions if more than one, if nore present or false it means AND each condition (if more than one)
filter:{any:true/false,items:[
{op:"OPERATOR",value:One of an array of strings, single string or single value of any supported type, i.e. int, decimal, bool iso8601 date etc }
]}
Filter operators:
public const string OpEquality = "=";
public const string OpGreaterThan = ">";
public const string OpGreaterThanOrEqualTo = ">=";
public const string OpLessThan = "<";
public const string OpLessThanOrEqualTo = "<=";
public const string OpNotEqual = "!=";
public const string OpNotLike = "!%";
public const string OpStartsWith = "%-";
public const string OpEndsWith = "-%";
public const string OpContains = "-%-";
public const string OpNotContains = "!-%-";
TAGS - At server if equality compare value is an array of strings then it's assumed to be tags, if it's a single value then it's regular
Also relative date filters are supported and their implementation is entirely a CLIENT responsibility as it touches on Locale issues:
public const string Null = "{[null]}";
// public const string Yesterday = "{[yesterday]}";
// public const string Today = "{[today]}";
// public const string Tomorrow = "{[tomorrow]}";
// public const string LastWeek = "{[lastweek]}";
// public const string ThisWeek = "{[thisweek]}";
// public const string NextWeek = "{[nextweek]}";
// public const string LastMonth = "{[lastmonth]}";
// public const string ThisMonth = "{[thismonth]}";
// public const string NextMonth = "{[nextmonth]}";
// public const string FourteenDayWindow = "{[14daywindow]}";
// public const string Past = "{[past]}";
// public const string Future = "{[future]}";
// public const string LastYear = "{[lastyear]}";
// public const string ThisYear = "{[thisyear]}";
// public const string InTheLast3Months = "{[last3months]}";
// public const string InTheLast6Months = "{[last6months]}";
// public const string InTheLastYear = "{[lastcalendaryear]}";
// //Months THIS year
// public const string January = "{[january]}";
// public const string February = "{[february]}";
// public const string March = "{[march]}";
// public const string April = "{[april]}";
// public const string May = "{[may]}";
// public const string June = "{[june]}";
// public const string July = "{[july]}";
// public const string August = "{[august]}";
// public const string September = "{[september]}";
// public const string October = "{[october]}";
// public const string November = "{[november]}";
// public const string December = "{[december]}";
Client calculates dates and sends with DataListView when requesting a list
******************************** DEPRECATED MOSTLY BELOW ********************************************************
This all applies equally to a report or a list or a graph so all work basically the same but will refer only to "list" for simplicity: