1. #1
    Ext JS Premium Member
    Join Date
    Jul 2009
    Posts
    239
    Vote Rating
    2
    stephen.friedrich will become famous soon enough

      0  

    Default Column event headerresize not working?

    Column event headerresize not working?


    I am trying to write a plugin that reacts on resizes of grid columns:
    PHP Code:
    Ext.define('Ext.ux.plugins.SqueezeHeaderPlugin', {
                       
    alias'plugin.squeezeheader',

                      
    init: function(grid) {
                          var 
    columns grid.columns;
                          for(var 
    0count columns.lengthcount; ++i) {
                              var 
    column columns[i];
                              
    // Why doesn't this work (no event ever received):
                              
    column.on('headerresize'this.handleColumnHeaderResizethis);
                          }
                      },
                      ... 
    What's wrong here?
    With beta 3 handleColumnHeaderResize() is never called at all.




    BTW: If any support member is listening: Me and two colleagues are _still_ waiting on our "premium member" status.
    ExtJS 4 plugins:
    varheaders - short/normal/long column header
    clearbutton - mouseover clear button in text field
    Blog: fit4dev
    ExtJS User Group Hamburg

  2. #2
    Ext JS Premium Member
    Join Date
    Jul 2009
    Posts
    239
    Vote Rating
    2
    stephen.friedrich will become famous soon enough

      0  

    Default


    To answer my own question:
    The event is fired for _child_ header containers, so this works fine:
    grid.headerCt.on('headerresize', this.handleColumnHeaderResize, this);
    I did not really understand that there's a top level header container and each column is also a header container (used for column groups, right?).

    It did not help that the api docs for Column starts with "Clicking on a header will toggle..." (without describing the relationship to the header.Container base class) and clicking on the Ext.grid.header.Container link in the hierarchy gives a 404. Plus the headerresize event has no doc at all (should mention that changes of any _child_ column triggers the event).

    ExtJS 4 plugins:
    varheaders - short/normal/long column header
    clearbutton - mouseover clear button in text field
    Blog: fit4dev
    ExtJS User Group Hamburg

  3. #3
    Sencha User steffenk's Avatar
    Join Date
    Jul 2007
    Location
    Haan, Germany
    Posts
    2,657
    Vote Rating
    5
    steffenk has a spectacular aura about steffenk has a spectacular aura about steffenk has a spectacular aura about

      0  

    Default


    Hey,

    it's hard to change to headerContainer if you used all the grid stuff from Ext3. however, big advantage is that you have complete container functionality as layout options or custom things inside these containers..
    The hard thing is the new structure, new naming and different nesting.
    As you already found out, event delegating is one of the tricky part in Ext4, at least for me.
    vg Steffen
    --------------------------------------
    Release Manager of TYPO3 4.5

Similar Threads

  1. Adding mouseover event to column in column model
    By shameed in forum Ext 2.x: Help & Discussion
    Replies: 4
    Last Post: 28 Jun 2009, 4:46 PM
  2. tree event isn't working
    By brazhuca in forum Ext 2.x: Help & Discussion
    Replies: 0
    Last Post: 26 Nov 2008, 6:18 AM
  3. Event handler not quite working
    By zhahua in forum Ext 2.x: Help & Discussion
    Replies: 2
    Last Post: 5 Oct 2008, 7:55 AM
  4. column width is not working
    By drakon0 in forum Ext 2.x: Help & Discussion
    Replies: 3
    Last Post: 30 Apr 2008, 1:39 AM

Thread Participants: 1