Skip to content

Grouping

Grouping of the list items.


When assigning a rule to a property of Grouping, the rule will be passed an instance of the following proxy class as an argument:


Grouping Properties

Property Type Required
GroupingProperties complex No
Header object No

GroupingProperties

An array of EntitySet property names used to group list items, or a Rule that returns such an array. Property names not present in the EntitySet are ignored. Ensure that these fields are requested via the OData $select in the QueryOptions of Target so they are returned by the query.

  • type: complex

GroupingProperties Value

Any following options needs to be fulfilled.

Option 1

Array type:

All items must be of the type: string

Option 2

Expects return of GroupingProperties in array format.


Configuration for the header displayed above each grouped section. Define one or more GroupingItem entries in Items. If multiple are provided, only the first is used for rendering. Alternatively, Items can be a Rule that returns an array of GroupingItem objects. Only the first returned item will be rendered.

  • type: object with following properties.
Property Type Required Default
Items complex No

Items


Examples

  "Grouping": {
    "GroupingProperties": ["Country", "City"],
    "Header": {
      "Items": [{
        "Title": "Group Country - {Country}, City - {City}",
        "Styles": {
          "Title": "DataTableGroupHeaderItem",
          "BackgroundColor":"sectionBgColor"
        }
      }]
    }
  },

  ...

  "Target": {
    "EntitySet": "MyWorkOrderHeaders",
    "Service": "/MDKDevApp/Services/Amw.service",
    "QueryOptions": "$orderby=Country,City"
  },
.DataTableGroupHeaderItem {
  font-color: #ff0000;
  font-style: body; /*iOS only*/
}

.sectionBgColor {
  background-color: @mdkYellow1;
}