problem in using custom sort

vaibhav asked on August 23, 2019

Hi,
I am trying to use custom sort for few columns and rows but I want to achieve this on event of fieldslistclose. For custom sort I am using array of my sorting order. When particular field is changed,I want to change its sort order at runtime so I am using runQuery for this purpose. I am trying to provide new sortOrder by custom slice json. After executing runQuery the report object is holding the new sortOrder but this sorting is not getting applied actually. Is there any way to apply custom sort using runQuery?
Please Find the example I am doing. https://jsfiddle.net/fupzeqv1/
Thanks.

6 answers

Public
Vera Didenko Flexmonster August 23, 2019

Hello, 
 
Thank you for providing a JSFiddle example for illustration.
It helped us a lot to understand the situation better.
 
For this case, we kindly advise using the clear() and setReport() API calls.
Here is a JSFiddle example for illustration.
 
 
We would like to point out that there is an option for setting a custom sorting method.
For more details, please see https://www.flexmonster.com/api/sortingmethod/.
 

Please let us know if you have further questions.
 
Best Regards,
Vera

Public
vaibhav August 26, 2019

Hi,
Thank you for your answer but I can’t use setReport() as I don’t want to reload the report always because my data is big and i have a lot of elements for custom sort. We are currently working on trial version but we are going to buy Flexmonster and custom sorting is a very important feature for us. Please let me know if there is any possible way to do it with runQuery().
 

Public
Vera Didenko Flexmonster August 27, 2019

Hello, 
 
Thank you for your reply.
 
Custom sorting can be applied during runtime without reloading the report via the sortingMethod() API call.
Here is a JSFiddle example for illustration: https://jsfiddle.net/flexmonster/o2tavLkb/.
 

Please let us know if everything works fine for you.
 
Best Regards,
Vera

Public
vaibhav August 28, 2019

Hi Vera,
 sortingMethod() won’t help in our case.
We create a slice object with our own custom order in it. For ex:
column : “[{“uniqueName”:”Internal Rating”,
                   “sortOrder”:[“1″,”2+”,”2″,”2-“,”3+”,”3″,”3-“,”4+”,”4″,”4-“,”5+”,”5″,”5-“,”6+”,”6″,”6-“,”7+”,”7″,”7-“,”substandard”,”doubtful”,”loss”]},
                 {“uniqueName”:”[Measures]”}]”
This is one such element we may have multiple such elements for custom sort hence setReport() we feel is not ideal as u know it renders and takes time which is why we used runQuery() and just manipulate the slice object and pass it to runQuery(). Is this a problem with runQuery().
So can you please take this request into consideration for future release. 
 
Thanks.

Public
Vera Didenko Flexmonster August 28, 2019

Hello, 
 
Thank you for your reply.
 
Our team has taken your request into consideration.
We will add support for sortOrder in runQuery() in the minor release version with the ETA 24th of September.
 
Please let us know if you have any questions.
 
Best Regards,
Vera

Public
vaibhav August 28, 2019

Hi Vera,
Thanks for your quick response & considering the request.

Please login or Register to Submit Answer