Disable sorting in relationship grid

Hello community, 

Does anybody know if it's possible to disable the sorting of a few columns in a relationship grid? 

My guess is that the change should be done somewhere in the CodeTree, but I'm not sure where.

Thank you in advance.

  • Have you checked the "Order By" settings of the affected Properties in the ItemType definition? Just remove the Order By value should exclude the sorting for the affected columns.

    Edit: If you don´t see any "Order By" values, check if you have Server Method that is used for sorting. That´s a common trick to achieve descending sorting...

  • Hello Angela,

    None of the columns have an "Order By" value. I checked also for a method which sorts/disables sort but I didn't find any.

  • If you have a regular relationship, check the related ItemType AND the relationship ItemType for any settings regarding sorting.

    If a custom sorting is present, you normally see it due to the arrow in the header column.

    If you don´t have this one -> by default Aras sorts by id (or native sorting in sql database), which can lead to mixed up data by default.

  • I have a NULL relationship and except the "Order by", I don't see any other option related to sorting. The goal is to disable the custom sorting. In other words, if the user wants to sort by the column "Pos", he should be able to do it, but if he wants to sort by "Name", it shouldn't be possible.

  • Ah ok, you want to prevent custom sorting completely. Why? It shouldn´t do much harm.

    Not sure if what you want to achieve is possible. You can prevent editing of cells, but I don´t think you can prevent sorting.

    You maybe can try to overwrite the aria-sort attribute that is used for the column header cells. But there are right now no good Method options available to do Method/Function overwrites in relationships.

    "onLoad" Form Method may work a bit, but will probably be overwritten again when users refresh the relationships.

    Take a look at aria-sort in core.js, searchGrid.js or _Builder.js in codetree. These are parts of the sorting feature, but changes in these files would apply to all ItemTypes.