Magento2.1 ui grid, remove or clear filter issue (after removing filter, result row apply to whole collection)

Just to add to the previous solution by Tony Bartiloro. 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>

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


I have got the same issue on Magento 2.3 and resolved by using the following code in ui_component xml.

<dataSource component="Magento_Ui/js/grid/provider" name="listing_data_source">
        <settings>
            <storageConfig>
                <param name="indexField" xsi:type="string">primary_id</param>
            </storageConfig>
            <updateUrl path="mui/index/render"/>
        </settings>
        ...
        ...
</dataSource>