0

I have created a custom grid I am not able to sort the items of a column.(ascending and descending).If i click first time it will sort in ascending order.Second time it will descend the contents.But if i click again same single content will come many times.For example if i have 1 2 3 as ids it will show 1 1 1 3 times. enter image description here

1 Answer 1

2

This happened because of storage config you have to set your primary id as indexField

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

in you data provider argument

<argument name="dataProvider" xsi:type="configurableObject">
            <argument name="class" xsi:type="string">storepickupGridDataProvider</argument>
            <argument name="name" xsi:type="string">tesst_listing_data_source</argument>
            <argument name="primaryFieldName" xsi:type="string">entity_id</argument>
            <argument name="requestFieldName" xsi:type="string">id_s</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 name="storageConfig" xsi:type="array">
                        <item name="indexField" xsi:type="string">entity_id</item>
                    </item>
                </item>
            </argument>
        </argument>
1
  • 1
    @Dilip if answer help you. kindly accept answer. Jan 15, 2019 at 12:08

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.