Results 1 to 5 of 5

Thread: Get Column name of a selected Grid cell

  1. #1
    Ext JS Premium Member
    Join Date
    Nov 2009
    Location
    Cave
    Posts
    178
    Vote Rating
    2
      0  

    Default Get Column name of a selected Grid cell

    Ok i know someone has had this problem before, and i'm just hoping i'm overlooking something.
    In my grid i have a itemcontextmenu listener for a cell. when the cell is clicked on, i need to get the name of the column header. (Row OR Cell Model)
    surely this cant be hard, is it ?

    ive been searching docs etc for a few hours with no avail.
    Thanks!

  2. #2
    Ext JS Premium Member stevil's Avatar
    Join Date
    Nov 2007
    Location
    Denver, CO
    Posts
    1,045
    Vote Rating
    10
      0  

    Default

    myCellClickEventListener: function (view, record, item, index, evt) {
    var position = view.getPositionByEvent(evt),
    data = record.data,
    cellValue = data[this.columns[position.column].dataIndex];

    ...
    }

    hope this helps,

    stevil

  3. #3
    Ext JS Premium Member
    Join Date
    Nov 2009
    Location
    Cave
    Posts
    178
    Vote Rating
    2
      0  

    Default

    thanks so much, worked perfect : )

  4. #4
    Sencha User
    Join Date
    Feb 2011
    Posts
    63
    Vote Rating
    0
      0  

    Default got this instead :(

    message
    "Object #<HTMLTableRowElement> has no method 'getTarget'"
    name
    "TypeError"
    stack
    "TypeError: Object #<HTMLTableRowElement> has no method 'getTarget'\n
    type
    "undefined_method"

  5. #5
    Ext JS Premium Member stevil's Avatar
    Join Date
    Nov 2007
    Location
    Denver, CO
    Posts
    1,045
    Vote Rating
    10
      0  

    Default

    @joelchu,

    Gonna need some more detail on that one... where it's happening, what your config looks like... just posting an error message makes it hard to give a decent response.

    stevil

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •