1

As a default, Magento Admin has Paging option as 20, 30, 50,100,200 But I need to change it for Product, Customer & Order Grid.

I override the below files:

vendor/magento/module-customer/view/adminhtml/ui_component/customer_listing.xml
vendor/magento/module-sales/view/adminhtml/ui_component/sales_order_grid.xml
vendor/magento/module-catalog/view/adminhtml/ui_component/product_listing.xml

And Changed content inside tag:

From:

<paging name="listing_paging">
        <argument name="data" xsi:type="array">
            <item name="config" xsi:type="array">
                <item name="storageConfig" xsi:type="array">
                    <item name="provider" xsi:type="string">sales_order_grid.sales_order_grid.listing_top.bookmarks</item>
                    <item name="namespace" xsi:type="string">current.paging</item>
                </item>
                <item name="selectProvider" xsi:type="string">sales_order_grid.sales_order_grid.sales_order_columns.ids</item>
            </item>
        </argument>
    </paging>

To:

<paging name="listing_paging">
            <argument name="data" xsi:type="array">
                <item name="config" xsi:type="array">
                    <item name="storageConfig" xsi:type="array">
                        <item name="provider" xsi:type="string">customer_listing.customer_listing.listing_top.bookmarks</item>
                        <item name="namespace" xsi:type="string">current.paging</item>
                    </item>
                    <item name="selectProvider" xsi:type="string">customer_listing.customer_listing.customer_columns.ids</item>

                    <item name="sizesConfig" xsi:type="array">
                        <item name="value" xsi:type="string">25</item>
                        <item name="minSize" xsi:type="string">1</item>
                        <item name="maxSize" xsi:type="string">100</item>
                        <item name="options" xsi:type="array">
                            <item name="25" xsi:type="array">
                                <item name="value" xsi:type="string">25</item>
                                <item name="label" xsi:type="string">25</item>
                            </item>
                            <item name="30" xsi:type="array">
                                <item name="value" xsi:type="string">30</item>
                                <item name="label" xsi:type="string">30</item>
                            </item>
                            <item name="50" xsi:type="array">
                                <item name="value" xsi:type="string">50</item>
                                <item name="label" xsi:type="string">50</item>
                            </item>
                            <item name="100" xsi:type="array">
                                <item name="value" xsi:type="string">100</item>
                                <item name="label" xsi:type="string">100</item>
                            </item>
                        </item>
                    </item>                          
                </item>
            </argument>
        </paging>

But it's not helpful. What am I doing wrong here?

0

So finally I ended up with below solution. Check it out if you have same requirement:

Below are two main files paging option comes:

vendor/magento/module-ui/view/base/web/js/grid/paging/sizes.js
vendor/magento/module-ui/view/base/web/templates/grid/paging/sizes.html

Override in your theme. Now to change option in per page dropdown change below code as per your requirement:

        options: {
            '20': {
                value: 20,
                label: 20
            },
            '30': {
                value: 30,
                label: 30
            },
            '50': {
                value: 50,
                label: 50
            },
            '100': {
                value: 100,
                label: 100
            },
            '200': {
                value: 200,
                label: 200
            }
        },

Now do static content deploy php bin/magento s:s:d

Note: This will make changes for all Admin Grids.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.