0

I need to set some very high value as default in pager in product grid in adminhtml. Or to disable it whatsoever. Here's excerpt from my product_listing.xml

 <listingToolbar name="listing_top">
    <paging name="listing_paging">
        <argument name="data" xsi:type="array">
            <item name="config" xsi:type="array">
                <item name="sizesConfig" xsi:type="array">
                    <item name="value" xsi:type="string">66</item>
                    <item name="options" xsi:type="array">
                        <item name="66" xsi:type="array">
                            <item name="value" xsi:type="string">66</item>
                            <item name="label" xsi:type="string">66</item>
                        </item>
                    </item>
                </item>
            </item>
        </argument>
    </paging>
</listingToolbar>

Neither of those work: nor value, nor option. What did I do wrong?

2 Answers 2

0

You know that this change can break your view, right?

Having to load like 1k of products can result in memory overflow.

And you will be like wondering why this page is suddenly not working, consider talking to whoever you are doing it for, to change his mind :)

1
  • Yeah, I know that. But I need to do that nonetheless Commented Jan 13, 2020 at 6:26
0

I got it. Basically you need to do two things.

1) Create file Vendor/Module/view/adminhtml/ui_component/product_listing.xml and fill it that:

<?xml version="1.0" encoding="UTF-8"?>
<listing xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Ui:etc/ui_configuration.xsd">
    <listingToolbar name="listing_top">
       <paging name="listing_paging">
            <argument name="data" xsi:type="array">
                <item name="config" xsi:type="array">
                    <item name="sizesConfig" xsi:type="array">
                        <item name="value" xsi:type="number">5000</item>
                        <item name="maxSize" xsi:type="number">9999</item>
                        <item name="options" xsi:type="array">
                            <item name="5000" xsi:type="array">
                                <item name="value" xsi:type="string">5000</item>
                                <item name="label" xsi:type="string">5000</item>
                            </item>
                        </item>
                    </item>
                </item>
            </argument>
        </paging>
    </listingToolbar>
</listing>

2) Truncate table ui_bookmark. Or delete rows for specific user from it.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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