Highlighted

Sorting issue in List view customization in Assets

Avatar

Avatar

saibul

Avatar

saibul

saibul

18-09-2019

I want to populate a new column named File Name with sortable in List view in Assets with. To just to populate the files names, I overlayed the following nodes.

  • /apps/dam/gui/content/commons/availablecolumns
  • /apps/dam/gui/coral/components/admin/contentrenderer/row

I reused the overlayed ../availablecolumns/language node and changed the jcr:title to "File Name" instead of creating a new one.

In  overlayed asset.jsp Added the String filename = resource.getName(); inside the scriplet I replaced the  <%= filename %> by <%= displayLanguage %> in the <td> element.

Everything is working perfectly including sorting when the content list is <=40 since it does the client-side sorting.

If the content list >40 then it calls the GET Api with ?sortName=language&sortDir=asc and get the results and populate the result but sorting not happens. except sorting everything is fine.  Need sorting as well in the customized column. rest of the columns are sorting as expected.

Replies

Highlighted

Avatar

Avatar

Vish_dhaliwal

Employee

Avatar

Vish_dhaliwal

Employee

Vish_dhaliwal
Employee

18-09-2019

Afaik, the server-side sorting on any custom column is not supported by AEM yet.

Regards,

Vishu

Highlighted

Avatar

Avatar

SonDang

Employee

Avatar

SonDang

Employee

SonDang
Employee

18-09-2019

What version of AEM are you using? I believe that we started supporting server-side sorting for OOTB properties starting in AEM 6.3. However, I don't believe have support for custom properties yet.

Highlighted

Avatar

Avatar

saibul

Avatar

saibul

saibul

19-09-2019

SonDang, sorry for not including the details and the aem version is 6.3.2.

Just I set jcr:title:File Name and default:true in availablecolumns/language and updated the filename in the corresponding td element in asset.jsp as said in my original post.

Still, I using the OOTB properties and not added any custom nodes or properties.

And one more thing I tried is, if I have the  <%= filename %> in other tds (title, type) then it sorts fine and expected.

I doubt the server sorts based on the columns or we need to configure somewhere. Thanks .