I try to create custom admin grid. When I search for information It can be searched But after I cancel the search The result is a duplicate of every item.



You can fix this issue it by adding the storageConfig and the indexField item under the settings tag.
It will be something like this (Comments on the code will give you more information):
<dataSource name="push_notification_pushNotificationLog_listing_data_source">
<argument name="dataProvider" xsi:type="configurableObject">
<!-- ... -->
<argument name="primaryFieldName" xsi:type="string">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"/>
<!-- Add below tag -->
<item name="storageConfig" xsi:type="array">
<!-- Set it to your table primary key -->
<item name="indexField" xsi:type="string">id</item>
</item>
</item>
</argument>
</argument>
<!-- ... -->
</dataSource>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With