Support Article
Column Headers not aligned in hierarchical table
SA-88846
Summary
The first column in a table is misaligned. On the initial load, the column is aligned correctly. However, on creating a subcase and returning to the screen with the grid, the column is misaligned.
Error Messages
Not Applicable
Steps to Reproduce
- Configure a grid in a section.
- Configure a button to create a subcase in the same section.
Root Cause
The misalignment occurred because the section containing the tree grid was refreshed when it was not visible. The logic to calculate the header height depends on properties such as offsetHeight which are not available correctly when the section is hidden from view.
Resolution
Perform the following local-change:
Add the below script in the UserWorkForm to refresh the section when switching tabs.
<script>
pega.u.d.attachOnload(function() {
pega.ui.EventsEmitter.subscribe("onTabSwitch", function() {
if (document.querySelector('[data-node-id=pyAssignmentListGadget]')) {
pega.api.ui.actions.refreshSection({
section: 'pyAssignmentListGadget'
});
}
}, null, null, null, true);
});
</script>
Published December 2, 2021
Have a question? Get answers now.
Visit the Collaboration Center to ask questions, engage in discussions, share ideas, and help others.