Open bartlomiej-k opened 11 months ago
Its been tricky to get this to work. It should work better if you set the width of the modal to some specific default (by setting the contents width).
In the modal/action panel it works fine, it doesn't work outside of it.
@tmcconechy, could you maybe introduce a method to recalculate specific column width? I see that there are two methods in datagrid: calculateTextWidth and setColumnWidth, but they are both private.
You could create something like recalculateColumnWidth, which would take the column id, calculateTextWidth and then setColumnWidth. Then we can trigger that on our side when the value resolves.
There is also some recalculation logic in updateCellNode:
But it has this additional condition ((newWidth - this.stretchColumnWidth) > this.stretchColumnDiff)
that I don't understand entirely, so some columns would not update their width.
Describe the bug We have a lookup component that allows users to choose an entry from a DB. This component accepts entry ID as one of its inputs to set its initial value and in such case, this ID will be translated to a chosen record. That means the display value of the component is loaded lazily and it can take a few seconds to resolve.
When a component of this kind is used as a column formatter component in Datagrid and no column size is specified, the autosizing mechanism doesn't work - the column size is determined only by its header and the cell content is ignored. What's suprising, it works correctly when the Datagrid is placed in Contextual Action Panel. The datasource for the grid doesn't change - the component itself keeps the ID value and the text value displayed to the user.
To Reproduce Steps to reproduce the behavior:
Expected behavior Column resizes itself after the component value changes, similar to what can be seen in the action panel.
Version
Screenshots Observed: Expected:
Platform