Threaded View

  1. #1
    Sencha User
    Join Date
    Mar 2010
    Posts
    39
    Answers
    2
    Vote Rating
    0
    WBX is on a distinguished road

      0  

    Default Answered: Grid cell tooltips for Ext.grid.column.Column convenience subclasses?

    Answered: Grid cell tooltips for Ext.grid.column.Column convenience subclasses?


    I used the example posted here: http://www.sencha.com/forum/showthread.php?179016 to successfully implement grid cell tooltips. Unfortunately, when used with a Ext.grid.column.Date column it overrides the defaultRenderer method and its associated formatting and this should also be the case with the other Ext.grid.column.Column convenience subclasses. Is there an alternative method for implementing tooltips for these column types?

    Thanks
    Last edited by WBX; 28 Nov 2012 at 1:26 PM. Reason: Changed title

  2. I got this to work on a per column basis:

    http://jsfiddle.net/GDW13/y3DHn/1/

    Code:
    Ext.tip.QuickTipManager.init();
    
    Ext.create('Ext.data.Store', {
        storeId:'employeeStore',
        fields:['firstname', 'lastname', 'seniority', 'dep', 'hired'],
        data:[
            {firstname:"Michael", lastname:"Scott", seniority:7, dep:"Management", hired:"01/10/2004"},
            {firstname:"Dwight", lastname:"Schrute", seniority:2, dep:"Sales", hired:"04/01/2004"},
            {firstname:"Jim", lastname:"Halpert", seniority:3, dep:"Sales", hired:"02/22/2006"},
            {firstname:"Kevin", lastname:"Malone", seniority:4, dep:"Accounting", hired:"06/10/2007"},
            {firstname:"Angela", lastname:"Martin", seniority:5, dep:"Accounting", hired:"10/21/2008"}
        ]
    });
    
    cellTooltipRenderer = function(value, metaData, record, rowIdx, colIdx, store) {
        var column = this.headerCt.getGridColumns()[colIdx];
        var newVal;
        switch (column.xtype) {
        case 'booleancolumn':
            newVal = Ext.create('Ext.grid.column.Boolean').defaultRenderer(value);
            break;
        case 'datecolumn':
            newVal = Ext.create('Ext.grid.column.Date', {format: column.format}).defaultRenderer(value);
            break;
        case 'numbercolumn':
            newVal = Ext.create('Ext.grid.column.Number').defaultRenderer(value, column.format);
            break;
        case 'templatecolumn':
            newVal = Ext.create('Ext.grid.column.Template', {tpl: column.tpl}).defaultRenderer(value, metaData, record);
            break;
        case 'actioncolumn':
        default:
            newVal = value;
        }                        
        metaData.tdAttr = 'data-qtip="' + newVal + '"';
        return newVal;
    };
            
    Ext.create('Ext.grid.Panel', {
        title: 'Column Demo',
        store: Ext.data.StoreManager.lookup('employeeStore'),
        columns: [
            {text: 'First Name',  dataIndex:'firstname', renderer: cellTooltipRenderer},
            {text: 'Last Name',  dataIndex:'lastname', renderer: cellTooltipRenderer},
            {text: 'Hired Month',  dataIndex:'hired', xtype:'datecolumn', format:'M', renderer: cellTooltipRenderer},
            {text: 'Department (Yrs)', xtype:'templatecolumn', tpl:'{dep} ({seniority})', renderer: cellTooltipRenderer}
        ],
        width: 400,
        forceFit: true,
        renderTo: Ext.getBody()
    });
    It's not intended to be used with Action columns but it works with the other column types.

Thread Participants: 1

Tags for this Thread

Turkiyenin en sevilen filmlerinin yer aldigi xnxx internet sitemiz olan ve porn sex tarzi bir site olan mobil porno izle sitemiz gercekten dillere destan bir durumda herkesin sevdigi bir site olarak tarihe gececege benziyor. Sitenin en belirgin ozelliklerinden birisi de Turkiyede gercekten kaliteli ve muntazam, duzenli porno izle siteleri olmamasidir. Bu yuzden iste. Ayrica en net goruntu kalitesine sahip adresinde yayinlanmaktadir. Mesela diğer sitelerimizden bahsedecek olursak, en iyi hd porno video arşivine sahip bir siteyiz. "The Best anal porn videos and slut anus, big asses movies set..." hd porno faketaxi