2 Replies Latest reply on Mar 15, 2010 10:24 PM by crissy84

    Mouse Event Problems with DataGrid headerRenderer

    crissy84 Level 1

      Hi,

      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...

       

       

      <headerRenderer>

           <component>

                <vbox width="100%" height="75">

                          <text width="100%" text="blah"/>

                          <spacer height="100%"/>

                          <combobox/>

                </vbox>

           </component>

      </headerRenderer>

       

      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.

       

      Any ideas?

      Thanks!