I created ui grid in magento 2.1.0 and facing issue while removing filters or clear all filters from ui grid. My filtered result occupies whole grid means same row repeated in the whole grid after removing filter.

I figure out why this issue arise, but unable to fix this issue.

Issue arise due to mui/index/render get request does not fire while removing filter or clear all filter.

In fact it worked when 2 or more filters are applied and I remove them but not in case of last filtered applied.

  • This is happening due to special caching for 1st active appilied filter.Please give me any suggestions to resolve this issue. – rajneesh gupta Aug 13 '16 at 5:28
up vote 12 down vote accepted

Just to add to the previous solution. The specific fix is to add the 'storageConfig' item. If this is missing you will see the issue where row data is duplicated.

<item name="storageConfig" xsi:type="array">
    <item name="indexField" xsi:type="string">entity_id</item>
</item>

Where 'entity_id' is your primary key for the collection data, and also the same as defined in

<argument name="primaryFieldName" xsi:type="string">entity_id</argument>

And the following can be removed completely. As this is just duplicating the value specified already in the 'dataProvider' node.

<argument name="data" xsi:type="array">
    <item name="js_config" xsi:type="array">
        <item name="component" xsi:type="string">Magento_Ui/js/grid/provider</item>
    </item>
</argument>
  • yes you are right , its working now – rajneesh gupta Aug 24 '16 at 7:57
  • Cheers to your solution :) +1 from me – Keyur Shah Dec 12 '16 at 11:56

i had same issue and I resolve with this code in ui_component xml:

<dataSource name="storelocator_store_listing_data_source">
    <argument name="dataProvider" xsi:type="configurableObject">
        <argument name="class" xsi:type="string">StoreGridDataProvider</argument>
        <argument name="name" xsi:type="string">storelocator_store_listing_data_source</argument>
        <argument name="primaryFieldName" xsi:type="string">store_id</argument>
        <argument name="requestFieldName" xsi:type="string">id</argument>
        <argument name="data" xsi:type="array">
            <item name="config" xsi:type="array">
                <item name="component" xsi:type="string">Magento_Ui/js/grid/provider</item>
                <item name="update_url" xsi:type="url" path="mui/index/render"/>
                <item name="storageConfig" xsi:type="array">
                    <item name="indexField" xsi:type="string">store_id</item>
                </item>
            </item>
        </argument>
    </argument>
    <argument name="data" xsi:type="array">
        <item name="js_config" xsi:type="array">
            <item name="component" xsi:type="string">Magento_Ui/js/grid/provider</item>
        </item>
    </argument>
</dataSource>

Take a look at node name "DataProvider". Hope it helps

  • 2
    Yes , it worked great , Thanks a lot tony :) – rajneesh gupta Aug 19 '16 at 11:09
  • 2
    yup, It works like charm!! Thank a lot !! – Nalin Savaliya Dec 8 '16 at 14:11
  • thanks @Tony u have saved my time working perfect so +vote – Nagaraju Kasa Aug 4 '17 at 9:50

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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