IPFGrid formatter

Because the IPFGrid has many attribute options, they are grouped into tabs. For information about a specific option in the FDF Editor, click in the field to see the context-sensitive help.

Main Attributes tab

On this tab, you can specify information about the appearance of the grid: layout name, number of rows and columns, whether the grid displays horizontally or vertically, and so on.

Ordering Attributes tab

This tab contains the attribute options that can be used to sort the collection used by the layout. You can use Simple Order mode or Free-Form Ordering mode to set up the order for the collection.

Filtering Attributes tab

This tab contains the attribute options that can be used to filter the records retrieved from the collection used by the layout.

For example, say you add a grid FDF for the order status header. For this grid, you want to retrieve from the collection only orders where the type is not Estimate and where the status is either Complete or Ordered. You also want to filter the result so that only the orders whose numbers you provide as input to the grid field are displayed. In the Where clause you specify the static information (the information that is always the same): Type !='E' and Stat in ('C','O'). You then click Add and add a line for the variable part of the filter that will be provided at runtime: an Incoming Filter Property with both Name and Property set to CoNum. Now, whenever the example grid FDF is passed a filter, it looks within the filter defined for a filter item called CoNum. If it finds it, the grid FDF appends to the Where clause the condition that the CoNum property is equal to the value in the filter item.

The type of filter you specify determines what you specify in the Name field, as shown in this table:

Filter type

Name

Incoming Filter Property Specifies the name of the property within the incoming filter
Outer Layout Property Specifies the name of the property in the parent layout
Layout Variable Specifies the name of the layout variable
Outer Layout Variable Specifies the name of the layout variable in the parent layout
Session Variable Specifies the name of the session variable
Literal Specifies the literal value

Column and row alignment

When a floating top or bottom header is defined and the number of columns to display is 1, then each header and repeating section is an independent block such that if columns expand in any block, they do not cause an expansion in any other block. A similar behavior applies when a floating left or right header is defined and the number of rows to display is 1. In this case, if rows expand in any block, they do not cause expansion in any other block.

When an embedded header is defined, the header and repeating sections are all contained in a table and any expansion causes all other sections to expand. So in the case of an embedded top or bottom header when columns to display is 1, all columns will line up. In the case of an embedded left or right header when rows to display is 1, all rows will line up.

When rows and columns are both greater than 1, the behavior is the same as in the floating header scenario in that an expansion in one section does not cause an expansion in another section.

If no headers are defined, then:

  • For columns of 1, the behavior is to line up the columns.
  • For rows of 1, the behavior is to not line up the rows.

Orientation type

If you need additional customization of the grid’s orientation beyond the options in the FDF Editor Orientation field, this API is available on both client and server:


enum IPFGridOrientationType
{
 Horizontal,
 Vertical
};
IPFGridOrientationType context.GetOrientation();
context.SetOrientation(IPFGridOrientationType);

Paging

Users can page through records when the entire collection is not visible at one time in the grid. If you need additional customization to set the first displayed index of the collection that is displayed in the grid, you can use these API calls:


context.SetFirstDisplayedItemIndex(recordNumber)
context.SetFirstDisplayedItemIndexToNextRowOrColumn()
context.SetFirstDisplayedItemIndexToPreviousRowOrColumn()
context.SetFirstDisplayedItemIndexToRowOrColumn(rowNumber)
context.SetFirstDisplayedItemIndexToNextPage()
context.SetFirstDisplayedItemIndexToPreviousPage()
context.SetFirstDisplayedItemIndexToPage(pageNumber)

In the calls that reference RowOrColumn, the number of records advanced depends on the orientation type defined on the grid. The calls that reference Page advance a number of records equal to rowsXcolumns.

Additional APIs are available on an item to facilitate paging:

boolean IPFItemI.GetIsLast() is available on an item. For example, context.GetItem(0).GetIsLast()

boolean IPFItemI.GetIsFirst() is available on an item

number context.GetFirstDisplayedItemIndex()

number context.GetLastDisplayedItemIndex()

If GetIsLast() is true for the item at context.GetLastDisplayedItemIndex(), then there are no further items to display and the page down button could be disabled. Conversely, if GetIsFirst() is true for the item at context.GetFirstDisplayedItemIndex(), then there are no previous items to display and the page up button could be disabled.

Note: After the set call is made to change the first displayed item index, the get call may immediately reflect the change. The system may need to retrieve server records, to ensure that the index is valid, before making the change visible to the get call.

Scrolling

Scrolling transitions in grids can only be specified through scripting.

By default for grids, the system determines the number of records that are read from the data source and the number of items that are available to client scripting. To support fast scrolling, the system can read in more than one page of records. The actual number of records available to client scripting is visible through the GetFirstReadyItemIndex() and GetLastReadyItemIndex() APIs.

Additional control ReadyRecords can be specified as the number of records the architecture should maintain ahead of the last displayed index and prior to the first displayed index. All the visible items and ready items are accessible through the ReadyRecords option setting.

If a ReadyRecords value is specified, the specification is followed. For example, if the number of records per page is 10 and ReadyRecords is 5 and there is a scroll to the next page, the scroll starts immediately and might display blank records for a time until they can be retrieved from the data source and returned to the client.

Further, if a scroll request is made to a record past the end of the number of records available in the collection and it is not yet known how many records are in the collection, the scroll starts immediately and might display blank records for a time until the data is retrieved. After the data is retrieved and the last record number is known, the system scrolls back to the last page of records in the collection.

These scripting APIs are available to facilitate access to items:



  • context.GetFirstDisplayedItemIndex() - Item index of the first item currently displayed by the IPFGrid.
  • context.GetLastDisplayedItemIndex() - Item index of the last item currently displayed by the IPFGrid.
  • context.GetFirstReadyItemIndex() - Index of an item prior or equal to the first displayed item. This is always less than or equal to the first displayed item index.
  • context.GetLastReadyItemIndex() - Index of an item equal to or after the last displayed item. This is always greater than or equal to the last displayed item index.

Client scripting can access the items between the first and last scroll-ready indexes. These index properties and the items available are updated as the displayed items are changed.

Note: For existing IPFGrid FDFs used with a bound layout, if the Pager formatter or no pager formatter was specified on a cell in the layout for that grid, then users can use the mouse wheel (or swipe on a mobile device) to scroll through records. No scroll bar is displayed on the page. This is legacy scrolling behavior.

IPF 4.1 added the extend and auto extend pager types, which, by default, disable use of the mouse wheel and swipe for scrolling. Instead, a scroll bar is displayed.

If for any reason you need to turn off legacy scrolling for an existing IPF Grid FDF, open it in the FDF Editor and on the Main Attributes tab set Enable Swipe Scrolling to False. This option is set to False by default when you create new Grid FDFs.

For more information about pager types, see IPFPager formatter.