2

enter image description hereThe problem :

When you apply filter or pagination, then removing filter, same row content being repeat in the whole page grid. Here is the file where I am making mistakes?

<?xml version="1.0" encoding="UTF-8"?>
<listing xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:noNamespaceSchemaLocation="../../../../../Magento/Ui/etc/ui_configuration.xsd">    

    <argument name="data" xsi:type="array">
        <item name="js_config" xsi:type="array">
            <item name="provider" xsi:type="string">replacement_member_listing.replacement_member_listing_data_source</item>
            <item name="deps" xsi:type="string">replacement_member_listing.replacement_member_listing_data_source</item>
        </item>
        <item name="spinner" xsi:type="string">replacement_member_listing_columns</item>
    </argument>    
    <dataSource name="replacement_member_listing_data_source">
        <argument name="dataProvider" xsi:type="configurableObject">
            <argument name="name" xsi:type="string">replacement_member_listing_data_source</argument>
            <argument name="class" xsi:type="string">Aayanshtech\Replacement\Ui\DataProvider\MemberDataProvider</argument>
            <argument name="primaryFieldName" xsi:type="string">w_id</argument>
            <argument name="requestFieldName" xsi:type="string">id</argument>
            <argument name="data" xsi:type="array">
                <item name="config" xsi:type="array">
                    <item name="update_url" xsi:type="url" path="mui/index/render" />
                 </item>
               <item name="storageConfig" xsi:type="array">
                     <item name="indexField" xsi:type="string">w_id</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>    
    <container name="listing_top">
        <argument name="data" xsi:type="array">
            <item name="config" xsi:type="array">
                <item name="template" xsi:type="string">ui/grid/toolbar</item>
            </item>
        </argument>
        <bookmark name="bookmarks">
            <argument name="data" xsi:type="array">
                <item name="config" xsi:type="array">
                    <item name="component" xsi:type="string">Magento_Ui/js/grid/controls/bookmarks/bookmarks</item>
                    <item name="displayArea" xsi:type="string">dataGridAcions</item>
                    <item name="storageConfig" xsi:type="array">
                        <item name="saveUrl" xsi:type="url" path="mui/bookmark/save"/>
                        <item name="deleteUrl" xsi:type="url" path="mui/bookmark/delete"/>
                        <item name="namespace" xsi:type="string">replacement_member_listing</item>
                    </item>
                </item>
            </argument>
        </bookmark>       
        <filters name="listing_filters">
            <argument name="data" xsi:type="array">
                <item name="config" xsi:type="array">
                    <item name="displayArea" xsi:type="string">dataGridFilters</item>
                    <item name="dataScope" xsi:type="string">filters</item>
                    <item name="storageConfig" xsi:type="array">
                        <item name="provider" xsi:type="string">replacement_member_listing.replacement_member_listing.listing_top.bookmarks</item>
                        <item name="namespace" xsi:type="string">current.filters</item>
                    </item>
                    <item name="childDefaults" xsi:type="array">
                        <item name="provider" xsi:type="string">replacement_member_listing.replacement_member_listing.listing_top.listing_filters</item>
                        <item name="imports" xsi:type="array">
                            <item name="visible" xsi:type="string">replacement_member_listing.replacement_member_listing.replacement_member_listing_columns.${ $.index }:visible</item>
                        </item>
                    </item>
                </item>
            </argument>
            <filterInput name="order_number">
                <argument name="data" xsi:type="array">
                    <item name="config" xsi:type="array">
                        <item name="dataScope" xsi:type="string">order_number</item>
                        <item name="label" xsi:type="string" translate="true">Order Number</item>
                    </item>
                </argument>
            </filterInput>
             <filterInput name="first_name">
                <argument name="data" xsi:type="array">
                    <item name="config" xsi:type="array">
                        <item name="dataScope" xsi:type="string">first_name</item>
                        <item name="label" xsi:type="string" translate="true">First Name</item>
                    </item>
                </argument>
            </filterInput>
              <filterInput name="email">
                <argument name="data" xsi:type="array">
                    <item name="config" xsi:type="array">
                        <item name="dataScope" xsi:type="string">email</item>
                        <item name="label" xsi:type="string" translate="true">Email</item>
                    </item>
                </argument>
            </filterInput>
        </filters>
           <massaction name="listing_massaction">
            <argument name="data" xsi:type="array">
                <item name="config" xsi:type="array">
                      <item name="selectProvider" xsi:type="string">replacement_member_listing.replacement_member_listing.replacement_member_listing_columns.ids</item>
                    <item name="component" xsi:type="string">Magento_Ui/js/grid/tree-massactions</item>
                    <item name="indexField" xsi:type="string">w_id</item>
                </item>
            </argument>
            <!-- Mass actions which you want to add in your grid-->
            <action name="delete">
                <argument name="data" xsi:type="array">
                    <item name="config" xsi:type="array">
                        <item name="type" xsi:type="string">delete</item>
                        <item name="label" xsi:type="string" translate="true">Delete</item>
                        <item name="url" xsi:type="url" path="replacement/grid/massdelete"/>
                        <item name="confirm" xsi:type="array">
                            <item name="title" xsi:type="string" translate="true">Delete</item>
                            <item name="message" xsi:type="string" translate="true">Do you want to delete selected row record?</item>
                        </item>
                    </item>
                </argument>
            </action>
            <action name="massemail">
                <argument name="data" xsi:type="array">
                    <item name="config" xsi:type="array">
                        <item name="type" xsi:type="string">massemail</item>
                        <item name="label" xsi:type="string" translate="true">Send E-Mails</item>
                        <item name="url" xsi:type="url" path="replacement/grid/massemail"/>                       
                    </item>
                </argument>
            </action>
        </massaction>
         <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">replacement_member_listing.replacement_member_listing.listing_top.bookmarks</item>
                        <item name="namespace" xsi:type="string">current.paging</item>
                    </item>
                    <item name="selectProvider" xsi:type="string">replacement_member_listing.replacement_member_listing.replacement_records_columns.ids</item>
                </item>
            </argument>
        </paging>
    </container>    
    <columns name="replacement_member_listing_columns">
        <argument name="data" xsi:type="array">
            <item name="config" xsi:type="array">
                <item name="storageConfig" xsi:type="array">
                    <item name="provider" xsi:type="string">replacement_member_listing.replacement_member_listing.listing_top.bookmarks</item>
                    <item name="namespace" xsi:type="string">current</item>
                </item>
                  <item name="editorConfig" xsi:type="array">
                    <item name="selectProvider" xsi:type="string">replacement_member_listing.replacement_member_listing.replacement_member_listing_columns.ids</item>
                    <item name="enabled" xsi:type="boolean">true</item>
                    <item name="indexField" xsi:type="string">w_id</item>
                    <item name="clientConfig" xsi:type="array">
                        <item name="saveUrl" xsi:type="url" path="replacement/index/InlineEdit"/>
                        <item name="validateBeforeSave" xsi:type="boolean">false</item>
                    </item>
                </item>
                 <item name="childDefaults" xsi:type="array">
                    <item name="fieldAction" xsi:type="array">
                        <item name="provider" xsi:type="string">replacement_member_listing.replacement_member_listing.replacement_member_listing_columns_editor</item>
                        <item name="target" xsi:type="string">startEdit</item>
                        <item name="params" xsi:type="array">
                            <item name="0" xsi:type="string">${ $.$data.rowIndex }</item>
                            <item name="1" xsi:type="boolean">true</item>
                        </item>
                    </item>
                    <item name="storageConfig" xsi:type="array">
                        <item name="provider" xsi:type="string">replacement_member_listing.replacement_member_listing.replacement_member_listing.listing_top.bookmarks</item>
                        <item name="root" xsi:type="string">columns.${ $.index }</item>
                        <item name="namespace" xsi:type="string">current.${ $.storageConfig.root }</item>
                    </item>
                </item>
            </item>
        </argument>
        <selectionsColumn name="ids">
            <argument name="data" xsi:type="array">
                <item name="config" xsi:type="array">
                    <item name="resizeEnabled" xsi:type="boolean">false</item>
                    <item name="resizeDefaultWidth" xsi:type="string">55</item>
                    <item name="indexField" xsi:type="string">w_id</item>
                </item>
            </argument>
        </selectionsColumn>
          <column name="w_id">
           <argument name="data" xsi:type="array">
               <item name="config" xsi:type="array">
                   <item name="filter" xsi:type="string">number</item>
           <item name="sorting" xsi:type="string">desc</item>
                   <item name="label" xsi:type="string" translate="true">Id</item>
               </item>
           </argument>
       </column> 
       <column name="created_at" class="Magento\Ui\Component\Listing\Columns\Date" >
           <argument name="data" xsi:type="array">
               <item name="config" xsi:type="array">
                   <item name="filter" xsi:type="string">dateRange</item>
                   <item name="component" xsi:type="string">Magento_Ui/js/grid/columns/date</item>
                   <item name="dataType" xsi:type="string">date</item>
                   <item name="label" xsi:type="string" translate="true">Created At</item>
               </item>
           </argument>
       </column>
    <column name="order_number">
           <argument name="data" xsi:type="array">
               <item name="config" xsi:type="array">
                   <item name="filter" xsi:type="string">text</item>
                   <item name="label" xsi:type="string" translate="true">Order number</item>
               </item>
           </argument>
       </column>   
        <column name="first_name">
           <argument name="data" xsi:type="array">
               <item name="config" xsi:type="array">
                   <item name="filter" xsi:type="string">text</item>
                   <item name="label" xsi:type="string" translate="true">First Name</item>
               </item>
           </argument>
       </column>   
       <column name="email">
           <argument name="data" xsi:type="array">
               <item name="config" xsi:type="array">
                   <item name="filter" xsi:type="string">text</item>
                   <item name="label" xsi:type="string" translate="true">Email</item>
               </item>
           </argument>
       </column>   
         <column name="track_code">
           <argument name="data" xsi:type="array">
               <item name="config" xsi:type="array">
                 <item name="editor" xsi:type="array">
                    <item name="editorType" xsi:type="string">text</item>
                    <item name="validation" xsi:type="array">
                        <item name="required-entry" xsi:type="boolean">true</item>
                    </item>
                  </item>                
                  <item name="filter" xsi:type="string">text</item>
                  <item name="label" xsi:type="string" translate="true">Track Code</item>
               </item>
           </argument>
       </column> 
       <column name="status">
            <argument name="data" xsi:type="array">
              <item name="sortOrder" xsi:type="number">50</item>
                <item name="options" xsi:type="object">Aayanshtech\Replacement\Ui\Component\Listing\Grid\Column\Status</item>
                <item name="config" xsi:type="array">
                    <item name="filter" xsi:type="string">select</item>
                    <item name="label" xsi:type="string" translate="true">Status</item>
                    <item name="component" xsi:type="string">Magento_Ui/js/grid/columns/select</item>
                    <item name="dataType" xsi:type="string">select</item>
                    <item name="editor" xsi:type="array">
                    <item name="editorType" xsi:type="string">select</item>
                        <item name="validation" xsi:type="array">
                            <item name="required-entry" xsi:type="boolean">false</item>
                        </item>
                    </item>
                </item>
            </argument>
        </column>
       <!-- Add Action with each row of grid and for this we will create a class Action -->
       <actionsColumn name="actions" class="Aayanshtech\Replacement\Ui\Component\Listing\Grid\Column\Action">
           <argument name="data" xsi:type="array">
               <item name="config" xsi:type="array">
                   <item name="resizeEnabled" xsi:type="boolean">false</item>
                   <item name="resizeDefaultWidth" xsi:type="string">107</item>
                   <item name="indexField" xsi:type="string">id</item>
               </item>
           </argument>
       </actionsColumn>      
    </columns>
</listing>
2

I updated this

    <dataSource component="Magento_Ui/js/grid/provider" name="xigen_testimonial_testimonial_listing_data_source">
        <settings>
            <updateUrl path="mui/index/render"/>
        </settings>
    <aclResource>Xigen_Testimonial::Testimonial</aclResource>
        <dataProvider class="Magento\Framework\View\Element\UiComponent\DataProvider\DataProvider" name="xigen_testimonial_testimonial_listing_data_source">
            <settings>
                <requestFieldName>id</requestFieldName>
                <primaryFieldName>testimonial_id</primaryFieldName>
            </settings>
        </dataProvider>
    </dataSource>

To this

https://github.com/DominicWatts/Testimonial/blob/master/view/adminhtml/ui_component/xigen_testimonial_testimonial_listing.xml#L21-L38

<dataSource name="xigen_testimonial_testimonial_listing_data_source">
        <aclResource>Xigen_Testimonial::Testimonial</aclResource>
        <argument name="dataProvider" xsi:type="configurableObject">
            <argument name="class" xsi:type="string">Magento\Framework\View\Element\UiComponent\DataProvider\DataProvider</argument>
            <argument name="name" xsi:type="string">xigen_testimonial_testimonial_listing_data_source</argument>
            <argument name="primaryFieldName" xsi:type="string">testimonial_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" path="mui/index/render" xsi:type="url"/>
                    <item name="storageConfig" xsi:type="array">
                        <item name="indexField" xsi:type="string">testimonial_id</item>
                    </item>
                </item>
            </argument>
        </argument>
    </dataSource>

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.