Table (Grid): Configuration of the Search in the Table
To configure the search in the table, you need to specify fast filter settings for the table. A fast filter is applied to the table when a user enters a value in the Search box of the table or in another box on an MYOB Acumatica form if the field that corresponds to this box is used for fast filtering.
Hiding the Search Box or Changing Its Position
By default, the Search box of a table is displayed on the filter bar of the table. You can hide the Search box or display it on the table toolbar by using the showFastFilter property in the gridConfig decorator, as the following example shows.
@gridConfig({
showFastFilter:
GridFastFilterVisibility.False
})
export class FieldValue
extends PXView
Including Columns in the List of Searched Fields
To include columns in the list of searched fields, you use the allowFastFilter property in the columnConfig decorator for the needed columns or the fastFilterByAllFields property in the gridConfig decorator. Take into account the following considerations:
- By default, the search is performed in all string columns.
- To exclude particular columns from the search,
fastFilterByAllFields
is not needed; you need to useallowFastFilter: false
. - To have only particular columns searched, you can set
fastFilterByAllFields: false
andallowFastFilter: true
for only these columns.
Using a Field Value for Fast Filtering
You may need to filter records in the table by a value that a user has specified in a box on the MYOB Acumatica form. To use a field value for fast filtering, you do the following:
- Specify an alias for the view model of the qp-grid element, as the
following code shows.
<qp-grid id="gridSiteStatus" view.bind="ItemInfo" view-model.ref="gridSiteStatusVM"> </qp-grid>
- Use this alias in the qp-fast-filter attribute of the field that
should be used as a fast filter for the table, as shown
below.
<field name="Inventory" qp-fast-filter.bind="gridSiteStatusVM"> </field>
<field name="Inventory"
qp-fast-filter.bind="[gridSiteStatusVM, gridRelatedItemsVM]">
</field>