1. #1
    Sencha User
    Join Date
    Mar 2011
    Posts
    4
    Vote Rating
    0
    Eich is on a distinguished road

      0  

    Default Grid column-header click-event

    Grid column-header click-event


    Hi there,
    i tried to set the column-headers of a grid clickable, but gxt doesnt like me .

    I tried to catch the click-event in few different ways:
    Code:
    final ColumnConfig column = new ColumnConfig(ID, NAME, WIDTH);
    column.addListener(Events.HeaderClick, new Listener<BaseEvent>() {
    Code:
    final ColumnConfig column = new ColumnConfig(ID, NAME, WIDTH);
    column.addListener(Events.OnClick, new Listener<BaseEvent>() {
    I only want to catch a click-event (grid column header).

    Thanks for every help ;D

    Greetings Daniel

  2. #2
    Sencha User
    Join Date
    Oct 2010
    Posts
    129
    Vote Rating
    0
    blay is on a distinguished road

      0  

    Default


    You have to add the listener but to the "header" Widget, not to the column.
    It would be something like the following code (I have not tested it, so maybe you have to try a little bit)

    grid.getView().getHeader().getHead(numberOfTheColumn).addListener...

  3. #3
    Sencha User
    Join Date
    Sep 2007
    Posts
    13,971
    Vote Rating
    132
    sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light

      0  

    Default


    No, this also may works but is the wrong approach.


    grid.addListeners(Events.HeadercLick,.... is the correct one.

  4. #4
    Sencha User
    Join Date
    Mar 2011
    Posts
    4
    Vote Rating
    0
    Eich is on a distinguished road

      0  

    Default


    Thanks a lot sven. This was/is the solution. Really simple (if you know what to do .

Similar Threads

  1. Not able to sort grid column on click of column header
    By amanind in forum Ext 3.x: Help & Discussion
    Replies: 31
    Last Post: 9 Nov 2010, 5:54 AM
  2. What happens on grid column header click?
    By Steve973 in forum Ext GWT: Discussion
    Replies: 4
    Last Post: 22 Jun 2010, 8:26 AM
  3. grid header double click event
    By shanney in forum Ext 2.x: Help & Discussion
    Replies: 3
    Last Post: 1 Mar 2010, 7:23 PM
  4. How to call a javascript function on column header click in ext js grid?
    By ketanmulay in forum Ext 3.x: Help & Discussion
    Replies: 3
    Last Post: 21 Jan 2010, 9:36 PM
  5. click grid column header programmingly
    By angelflaree in forum Ext 2.x: Help & Discussion
    Replies: 0
    Last Post: 3 Apr 2008, 7:40 AM

Thread Participants: 2