For context, we are using the sortingMethod api to define a custom sort order for one of our fields and our datasource is set to the Custom Datasource API. We had some questions regarding the sort order:
We have provided jsFiddles for convenience. As a prerequisite, to reproducing the above our observed behaviors, please click the "Custom Sorting" button prior to switching layouts.
Please let us know if you need any additional information or if there is something wrong with the jsFiddles!
Thank you for reporting the issue and for preparing examples.
Please note that sorting (ascending or descending) should also be defined for the flat form to be applied right after the form change. It is achievable using the
flatSort property of the Slice Object.
We modified your JSFiddle for the demonstration: https://jsfiddle.net/flexmonster/hynv7Lcu/.
sortingMethod seems to be erased after changing the form when using the custom data source API. This issue will be fixed in a minor update ETA on July 12. We will notify you when the version with a fix is available to download.
Feel free to reach out if any additional questions occur.
Thank you for pointing us to the
flatSort property! We noticed that if we have custom sorts on multiple fields, then if we change the ordering of the fields prior to changing the layout to the flat form, the custom sort order is lost when we change to the flat form. Is this the expected behavior? We've prepared a jsFiddle with custom sorting logic on the
Color fields for convenience. To reproduce,
Thank you for reporting this issue.
It seems to be reproducible without any custom sorting applied. Also, we noticed it only appears when reordering fields in the Field List. As a temporary workaround, we suggest reordering fields by dragging them directly on the grid.
The issue will be fixed along with another problem mentioned in this thread ETA July 12.
Feel free to contact us if other questions arise.
We are glad to inform you that issues with clearing flatSort when changing the slice and with sortingMethod when working with custom data source API were fixed.
This is included in the 2.9.3 version of Flexmonster: https://www.flexmonster.com/release-notes/.
You are welcome to update the component.
Here is our updating to the latest version guide for assistance: https://www.flexmonster.com/doc/updating-to-the-latest-version/.
Please contact us in case any questions arise.
We are reaching out to ask if the recent fix works for you.
Looking forward to your feedback.
Whoops, sorry about that. I've been meaning to respond with a follow up. Yes, upgrading to 2.9.3 looks to have fixed the order retention.
Although, we did notice that for the Custom Datasource API, the
aggregations at the root of the
fields response now has precedence over the
aggregations defined in the individual
fields. For example, if the root
sum, but a
field has an empty
sum appears as a valid
aggregation option for the field in the fields list. Is this the expected behavior? Please let us know if it would be best to make another post/question on the forum.
Thank you for your feedback.
Concerning aggregations, if we understand correctly,
root aggregations in your case means aggregations available for
date data types. In its turn, individual field aggregations imply aggregations defined for some specific hierarchies of your data source.
If so, we did not manage to reproduce the described behavior. Individual field aggregations have a higher priority than
Here is a JSFiddle for demonstration: https://jsfiddle.net/flexmonster/9dLcf583/.
It uses a sample predefined response where the "Price" field only has
count aggregation available. In its turn, other numeric fields have all default aggregations. As a result, only
count aggregation is available for the "Price" field.
Please note that array of aggregations should not be empty. Otherwise, all the
root ones will be activated.
If we did not understand you correctly, please modify the example mentioned earlier to demonstrate the issue.
Also, it would help us if you could create separate forum thread for different questions.
Looking forward to hearing from you.