on ‎2018 Oct 04 4:45 PM
Hello,
Is there a way to define a default sorting within submenus of Hybris Backoffice?
Inside the Attributes tab of a product, I have several menus of ClassificationClasses which I have provided with a 'position' via impex,
but the order of these menus is seemingly random. The position attribute does not seem to influence the order, it is not alphabetical or reverse, and the ClassificationClass codes are out of order (i.e. 10 20 70 40 30).
Can I define/influence how these submenus are displayed?
Request clarification before answering.
The "Attributes" tab in the backoffice is a special case, as it defines a completely custom renderer for the whole thing ( spring-bean="classificationTabEditorAreaRenderer")
And, it looks like the custom renderer doesn't respect the position, which for me means this is a bug.
If you need this solved now, you either have to override the custom renderer, or tweak how the features are loaded from the DB. the classificationTabEditorAreaRenderer uses DefaultClassificationService#getFeatures(ProductModel) to load the data.
I would try overriding the DefaultClassificationService with a custom implementation, that sorts the features by their position, this should influence the order in the backoffice too
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Actually, this is not a bug and it's the expected behaviour since by default those classification attributes are ordered in backoffice alphabetically.
This is done via the assureAlphabeticalAttributeOrder method of the ClassificationTabEditorAreaRenderer class using its FeatureComparator.
You can find the ClassificationTabEditorAreaRenderer bean definition in hybris/bin/ext-platform-backoffice/platformbackoffice/resources/platformbackoffice-backoffice-spring.xml file:
<alias name="defaultClassificationTabEditorAreaRenderer" alias="classificationTabEditorAreaRenderer"/>
<bean id="defaultClassificationTabEditorAreaRenderer"
class="de.hybris.platform.platformbackoffice.classification.ClassificationTabEditorAreaRenderer"
parent="abstractEditorAreaComponentRenderer">
....
<property name="featureComparator">
<bean class="de.hybris.platform.platformbackoffice.classification.comparator.FeatureComparator"/>
</property>
...
</bean>
</property>
</bean>
To implement your custom order you can override the ClassificationTabEditorAreaRenderer bean and provide your custom comparator which will be based on position.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
| User | Count |
|---|---|
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.