Order by a hidden field

Answered
talha asked on September 21, 2022

Hello,
 
Is it possible to order the report according to a value that is hidden but it exists at fields?

5 answers

Public
Maksym Diachenko Maksym Diachenko Flexmonster September 22, 2022

Hello,

Thank you for raising a ticket.

If we understand correctly, you would like to sort the grid based on a hidden field. Although Flexmonster does not provide sorting by a hidden field, there are two ways how you can sort the grid based on a custom sorting rule: 

1. Define a sorting function (see more details):
You can provide your own sorting logic with the sortingMethod API call. This way, you could specify a function that will define the sort order for a certain hierarchy (similar to the Array.sort() method).

2. Define a custom sort order using an array (only for JSON and CSV data sources) (see more details):
You can also specify how Flexmonster should order a field by providing an array of members. On the grid, the field's members will be displayed in the same order as in the array.

Is this something you are looking for? If your case is different, could you please provide more details on the desired functionality? Are you using the flat or compact/classic grid layout?
Looking forward to your reply.

Best Regards,
Maksym

Public
Maksym Diachenko Maksym Diachenko Flexmonster September 29, 2022

Hello,

Hope you are doing well.
Our team is wondering if you had time to check the provided methods for the implementation of custom sorting by a hidden field.
Looking forward to hearing from you.

Best Regards,
Maksym

Public
Maksym Diachenko Maksym Diachenko Flexmonster October 11, 2022

Hello,

We would like to know if you tried the described solutions for custom sorting.
Please let us know if they worked for you.

Best Regards,
Maksym

Public
eze@wejugo.com November 7, 2024

Hello, we would also be interested in this functionality.

To give a more concrete example, here's a jsfiddle:

https://jsfiddle.net/ezk84/zaqyk01g/10/

What we want is to show the sum(Discount) aggregation, but rows ordered according to the sum(Price) aggregation without having to show the sum(Price) aggregation. 

The default view shows the order of the rows that would be desired.
If one removes the commenting out making the field not visible through the mapping, that would shows the desired layout. 

Is that possible?

Public
Nadia Khodakivska Nadia Khodakivska Flexmonster November 8, 2024

Hello,

Thank you for reaching out to us.

Currently, Flexmonster does not support ordering rows or columns by the field that is not present on the grid. However, we have added this feature to our customers' wishlist. We will notify you if there are any updates.

You are welcome to contact us if other questions arise.

Kind regards,
Nadia

Please login or Register to Submit Answer