cancel
Showing results for 
Search instead for 
Did you mean: 

How to sort editorArea collection attribute in Backoofice?

0 Kudos

In Backoffice I am trying to sort a collection of items in the editorArea. I would like to sort the objects in the list for a given property of the object. In my case sort on the modifiedtime. I have tried including a sort field in the backoffice-config.xml but this is not working.

Is there another way to do this? I have tried the following but it is not working.

 <context type="LogFile" merge-by="type" component="simple-search">
     <simple-search:simple-search>
         <simple-search:field name="code" />
         <simple-search:sort-field asc="false" name="modifiedtime" />
     </simple-search:simple-search>
 </context>

Attached is snapshot of what I'm trying to order.

[1]: /storage/temp/12280-example-logfiles.png

Accepted Solutions (0)

Answers (1)

Answers (1)

former_member620692
Active Contributor
0 Kudos

Please try the following code:

 <context merge-by="type" parent="Media" type="LogFile" component="simple-search" module="platformbackoffice">
     <simple-search:simple-search xmlns:simple-search="http://www.hybris.com/cockpitng/config/simplesearch">
         <simple-search:field name="code" />
         <simple-search:field name="modifiedtime"/>
         <simple-search:sort-field asc="false" name="modifiedtime"/>
     </simple-search:simple-search>
 </context>
0 Kudos

Thank you for the suggestion. But I'm still facing same issue. The files are still from youngest to oldest. Is there some sort of config refresh/update that needs to take place before the changes are applied?

former_member620692
Active Contributor
0 Kudos

What is the result if you do not mention asc="false"? I mean, instead of <simple-search:sort-field asc="false" name="modifiedtime"/>, did you try <simple-search:sort-field name="modifiedtime"/>?

0 Kudos

Yes, I tried with and without. It's the same issue. It seems to me that it is not even being looked at. I may need to look into a different workaround as it doesn't seem to be working as excepted in my case.