0

I have created a custom column named printed which shows the invoice is printed or not and works well.

But how to apply sorting in in it like when i click on printed firstly it shows all data with pagination of printed yes then if i again click on it it sort by No.

So basically i want to know how to sort that data out by asc or desc order according to my printed value?

Any help is appreciated.

asked Jan 25, 2022 at 7:37

1 Answer 1

0

by default you should be able to click on the column to sort value ASC/DESC, unless you have added a <sortable>false</sortable> node inside the setting node like this:

<column name="store_id" class="Magento\Store\Ui\Component\Listing\Column\Store">
 <settings>
 <label translate="true">Purchase Point</label>
 <bodyTmpl>ui/grid/cells/html</bodyTmpl>
 <sortable>false</sortable>
 </settings>
</column>

If you have sortable node in there, delete it or set it to true.

If you mean to add a default sort when you go to the grid, without having to click on anything, then you have to add a sorting node.

More info here: https://devdocs.magento.com/guides/v2.4/ui_comp_guide/components/ui-column.html

answered Jan 25, 2022 at 8:32

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.