Sizes component
The Sizes component defines the maximum number of displayed records in a table (grid).
Options
Option
Description
Type
Default Value
componentThe path to the component’s
.js file in terms of RequireJS.String
'Magento_Ui/js/grid/paging/sizes'maxSizeMaximum allowed number of rows.
Number
999minSizeMinimum number of rows.
Number
1optionsThe initial list of available table sizes (number of rows).
Array
[]templatePath to the component’s
.html template.String
ui/grid/paging/sizesvalueInitial number of rows per page.
Number
20SizeOption interface
Option
Description
Type
Required
labelLabel displayed in the rendered options list. This label is usually equal to the corresponding
value property.String | Number
Required
valueOptions identifier which represents the table size.
Number
Required
Source files
Extends UiElement:
- app/code/Magento/Ui/view/base/web/js/grid/paging/sizes.js
- app/code/Magento/Ui/view/base/web/templates/grid/paging/sizes.html
Examples
Integration
This example integrates the Sizes component with the Paging component:
<listing>
<listingToolbar>
<paging name="listing_paging">
<argument name="data" xsi:type="array">
<item name="config" xsi:type="array">
<item name="sizesConfig" xsi:type="array">
<item name="component" xsi:type="string">Magento_Ui/js/grid/paging/sizes</item>
<item name="template" xsi:type="string">ui/grid/paging/sizes</item>
<item name="maxSize" xsi:type="number">500</item>
</item>
</item>
</argument>
</paging>
</listingToolbar>
</listing>
Result