Results 1 to 2 of 2

Thread: Extending ExtJS Grid Column to Enable listener for extjs column header

  1. #1
    Sencha User
    Join Date
    Oct 2015
    Posts
    15

    Default Extending ExtJS Grid Column to Enable listener for extjs column header

    Hi I have ExtJs Grid
    My Sample Code is Below, I am using version 3.2.x


    Code:
    Ext.onReady(function(){    // create the Data Store    var store = new Ext.data.Store({        // load using HTTP        url: 'sheldon.xml',        // the return will be XML, so lets set up a reader        reader: new Ext.data.XmlReader({               // records will have an "Item" tag               record: 'Item',               id: 'ASIN',               totalRecords: '@total'           }, [               // set up the fields mapping into the xml doc               // The first needs mapping, the others are very basic               {name: 'Author', mapping: 'ItemAttributes > Author'},               'Title', 'Manufacturer', 'ProductGroup'           ])    });    // create the grid    var grid = new Ext.grid.GridPanel({        store: store,        columns: [            {header: "Author", width: 120, dataIndex: 'Author', sortable: true},            {header: "Title", width: 180, dataIndex: 'Title', sortable: true},            {header: "Manufacturer", width: 115, dataIndex: 'Manufacturer', sortable: true},            {header: "Product Group", width: 100, dataIndex: 'ProductGroup', sortable: true}        ],        renderTo:'example-grid',        width:540,        height:200    });    store.load();});


    I wanted to add listener on all column grid header.

    For Example


    columns: [ {header: "Author", width: 120, dataIndex: 'Author',listeners: { mouseover: function(e, t) {
    var rowIndex = this.getView().findRowIndex(t);
    var colIndex = this.getView().findCellIndex(t);
    alert("mouse over:"+rowIndex+" " +colIndex);
    }

    }, sortable: true}, {header: "Title", width: 180, dataIndex: 'Title', sortable: true},


    By added the code which is bold text is not making any impact. Since there is no support for listener 3.2 X version of ExtJs column header.

    Can anyone Pls me on this?

    I need to have listener for ExtjS3.2x Column header.

    Thanks in Advance,

    Praveen.

  2. #2
    Sencha User
    Join Date
    Feb 2013
    Location
    California
    Posts
    11,985

    Default

    Yes, it looks like the 4 events for a grid column in 3.x are click based (click, dblclick, contextmenu and mousedown). I'm not sure that there is an easy way to do this. What is the use case?

Similar Threads

  1. Replies: 1
    Last Post: 12 May 2015, 5:44 AM
  2. Extjs Grid Column header menu
    By narram123 in forum Ext 3.x: Help & Discussion
    Replies: 1
    Last Post: 20 May 2013, 5:29 AM
  3. Replies: 4
    Last Post: 10 Apr 2013, 12:44 AM
  4. Replies: 5
    Last Post: 12 Nov 2012, 2:21 AM
  5. extjs editor grid column header
    By madhuchowdary in forum Community Discussion
    Replies: 4
    Last Post: 28 Mar 2011, 9:11 PM

Tags for this Thread

Posting Permissions

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