How do I add a default sorting to a grid?

Hello Novulo Community!

I am faced with a request to build functionality where the grid that I added is sorted by default.

The grid shows each product/customer combination, and how often the customer has bought the product. For quick add purposes in orders this grid is added, and needs to show the most purchased products on top. This is a computed field in the grid.

How can I set the default sorting to descending based on this computed field?

Hi Steffen,
If you want to force the sorting order in a grid, you can use the plugin Novulo Grid Extensions.

Add the plugin to your component. Then add a grid, right-click on it and apply the NGE Extended Grid. Then, you can force a sorting order.

1 Like

Iā€™d like to add that sorting on a computed field with a lot of rows can make loading the grid slow. If you expect the table to have more than 100000 rows you may want to take a look at the performance posts and think about indexes or have (a part of) the computation come from a cached field.

If you have a grid with a lot of data available you can test this by sorting on this column by hand and check in the performance analysis if there is big difference with not sorting on this column.