Filter

name

package type

unit price

supplier

Sorting

Grouping

name

package type

unit price

supplier

On the controller side the IWebQueryProvider is injected in the controller constructor
to get the OData query passed in the Url. IWebQueryProviderParse method is invoked in each
action method to get a QueryDescription object for a specific ViewModel. The query description object is used
to get current page, LinQ filter, sorting, and grouping that are passed to the repository GetPage method.
Please, notice that when the query contains grouping/aggregation a different overload of GetPage is called, that contains
a generic argument for the ViewModel to use for the aggregated items.
The grouping ViewModel MUST inherit from the ViewModel used for the standard item, and adds some more fields
to count different occurrences of properties. The name of these count properties, MUST be the name of the property they refer to
with the "Count" postfix.

QueryDescription object is passed to the View. There, its AttachEndpoint method is
invoked to specify the Url where to submit all OData queries.

In the View the QueryDescription object is passed to the grid TagHelper in its
query-for attribute. The grid TagHelper contains also enable-query="true"
to enable queries, sorting-clauses="2" to specify a maximum of 2 sorting clauses.
query-grouping-type specifies the type of the ViewModel used for grouping. Moreover,
a row-type TagHelper specifies how to render the grouping item. It ineriths settings from the
main row (from-row="0"), and adds just two count properties.
When grid is rendered in grouping mode only columns involved in current grouping and aggregations operations
are shown.

Pager
is configured to get page information from the QueryDescription object
passed to the grid TagHelper. Therefore, it contains just a few informations, namely:
css classes, max number of page links to show, page size, and the property
containing the total number of pages.
All other information needed by the pager are "inherithed" from the grid TagHelper.

Each query functionality (filtering, sorting and grouping) is added by simply putting
the associated query button in a toolbar. Query buttons are generated by the query
TagHelper. All information needed by query buttons is inherited by the grid TagHelper,
but may be overriden with attributes of the
query
TagHelper. The Functionalities.GroupDetail in the grid operations
attribute shows a group detail button on each grid row when the grid is in grouping mode. By clicking it
the grid shows all items that have beem grouped in the row whose button was clicked.
Functionalities.GroupDetailNew performs the same operation but shows the detail grid
in a new browser tab.