Add Grid From Data Provider action

Objective

Adding grids based on Data Providers to a web panel generated using K2BWebPanelDesigner involves many steps, as the developer must select the grid's columns, its filters, orders, and the Data Provider. To simplify this process, K2BWebPanelDesigner includes the "Add grid from Data Provider action". Using this action, a grid is added to the web panel, the Data Provider property is set, then it adds a variable for each SDT field in the first level of the Data Provider. Also if the Data Provider allows changing the output order and filtering it creates OrderBy and Filter nodes in the grid.

The inferred grid may not suit all needs, but is a very good starting point that the developer can customize later to suit its particular requirements.

How it works

Adding a grid from a Data Provider involves three steps:

  1. Choose the node under which the grid should be created. The developer may choose nodes from any type, as long as they support having grids as child nodes.
  2. Select the "Add Grid From Data Provider" action in the Actions menu inside the contextual menu belonging to the node chosen in the previous step.
    AddGridFromDataProviderMenu
    Contextual menu

  3. Choose the dataprovider the grid should be based on.
    AddGridFromDataProviderChooseDataProvider
    DataProvider selection

  4. Choose the layout that should be used when generating the grid. In this point you can choose a dynamic layout, a standard grid, or a free style grid.
    AddGridFromTransctionChooseLayout
    Layout selection

After following these steps, the result will be similar to the one shown below.

AddGridFromDataProviderGeneratedGrid
Generated grid

Grid inference

Columns

All first level fileds in the Data Provider's output SDT that are based on attributes or domains are included as variables in the inferred grid.

Filters

The dataprovider parameters that are included as filters are the ones that match all the conditions bellow:

  • It's based on an attribute or domain.
  • Its name is not PageSize, PageCount, OrderBy, OrderedBy, Skip or Count.

Orders

A Order node will be generated with descriptions "First Order" and "Second Order" only if the Data Provider matches one of the conditions below.

  • It contains a parameter called OrderBy or OrderedBy.