Grid Control 2.0

Use High-Performance Option for Large Categories

The Category Grid control's high-performance option is useful in applications with high volume of displayed records. For example, you may want to use this option in the following situation:

Thirty mobile surveyors collect tens of thousands of assessment records in the field. To dispatch these records, the compliance officer uses Web Central with a console that has a category grid. In their queue, the compliance officers might have 10,000 items to review at once.

When you enable the high-performance option, the category grid responds as follows:

  • Queries the categories and the total number of records for the categories first, then displays collapsed categories.
  • When you expand a category, queries the records in the category.
  • Queries records only to the record limit specified for the data source in the view, then displays the actual number fetched. For example, "Showing 500 of 10,402 total records."

Example view: http://localhost:8080/archibus/schema/ab-products/solutions/parts/grid/ab-ex-report-group-by-categories-v3.axvw

This example demonstrates:

  • How to define separate data sources for categories and for records.
  • How to match restrictions between two data sources, which is required for correct operation of the category grid.
  • How to update counts in the category data source and pass in console restrictions. See the onFilter function in ab-ex-report-group-by-categories-v3.js .
  • If a custom order is specified, any unspecified or remaining categories – such as Assigned to Work Order – are appended at the end.
  • The category grid allows you to switch to default grid mode. In this mode, if you wish to enable the mini-console filter, set showWithoutGroupings:true and showIndexAndFilterOnLoad="true".

To use the high-performance option:

  1. In order to have the category counts up front, add the count field to the category data source:

<dataSource id="statusDS" type="grouping"> <table name="wr" role="main"/> <field table="wr" name="status" groupBy="true"/> <field name="ct_status" formula="count" baseField="wr.status" dataType="number" decimals="0"> <title translatable="true">Count</title> </field> </dataSource>

An alternative version handles null values:

<dataSource id="statusDS" type="grouping"> <table name="wr" role="main"/> <field table="wr" name="status" groupBy="true"/> <field table="wr" name="ct_status" dataType="text"> <sql dialect="generic">count(ISNULL(status, '0'))</sql> <sql dialect="oracle">count(NVL(status, '0'))</sql> </field> </dataSource>

  1. Specify the count field in JavaScript:

this.workRequestsByBuildingGrid.setCategoryConfiguration({ fieldName: 'wr.status', countField: 'wr.ct_status', order: ['R', 'A', 'HA', 'HL', 'I', 'Com'], getStyleForCategory: this.getStyleForCategory });

  1. Add an index field to the data source:

<indexField table="wr" name="wr_id" />