I have a custom headerRenderer because I want to add a combobox at the top of each column in my datagrid. So, it is something like this...
<vbox width="100%" height="75">
<text width="100%" text="blah"/>
I'm having two problems.. 1 minor and 1 major.
#1 I would *prefer* to not have to set an explicit height on the header. Some text can be varying lengths and wraps, creating different heights. Ideally, the header would just resize to the tallest one. But if I don't explicitly set the the height, then header doesn't resize appropriately to fit all the content. Anybody know an easy way to do this?
#2 This is the real problem. My columns are sortable. When I click on the combobox in the header to open it, the click event gets passed through to the column header and it sorts the column. I've tried using stopPropagation on the event, toggling mouseEvents, etc, etc. No matter what I do, the column re-sorts when I click on the combobox.
#2. DG uses mouseDown/Up, not click, so block those too.
#1. The rules for itemrenderers is that they are given an explicitWidth and
then measure() is called to request their measuredHeight. You will need to
override measure() in your headerrenderer and calculate the measuredHeight.
And if you take the trouble to do that, then don't use Vbox, just use
UIComponent or ListItemRenderer and override updateDisplayList as well.
Perfect. Thanks so much.