Hybrid View

  1. #1
    Ext JS Premium Member
    Join Date
    Mar 2010
    Location
    Barcelona
    Posts
    33
    Vote Rating
    1
    deister is on a distinguished road

      1  

    Default Ext.ux.grid.HeaderToolTip

    Ext.ux.grid.HeaderToolTip


    A very simple extension to add tooltips to grid column headers:


    Code:
    /**
     * @class Ext.ux.grid.HeaderToolTip
     * @namespace Ext.ux.grid
     *
     *  Text tooltips should be stored in the grid column definition
     */
    Ext.define('Ext.ux.grid.HeaderToolTip', {
        alias: 'plugin.headertooltip',
        init : function(grid) {
            var headerCt = grid.headerCt
            grid.headerCt.on("afterrender", function(g) {
                grid.tip = Ext.create('Ext.tip.ToolTip', {
                    target: headerCt.el,
                    delegate: ".x-column-header",
                    trackMouse: true,
                    renderTo: Ext.getBody(),
                    listeners: {
                        beforeshow: function(tip) {
                            var c = headerCt.down('gridcolumn[id=' + tip.triggerElement.id  +']');
                            if (c  && c.tooltip)
                                tip.update(c.tooltip);
                            else
                                return false;
                        }
                    }
                });
            })
        }
    });

  2. #2
    Sencha User
    Join Date
    Apr 2011
    Posts
    37
    Vote Rating
    0
    cntx is on a distinguished road

      0  

    Default


    pretty nice, thx

  3. #3
    Sencha User
    Join Date
    Dec 2010
    Posts
    16
    Vote Rating
    0
    asmweb is on a distinguished road

      0  

    Default Does not work in MVC approach

    Does not work in MVC approach


    Hello,

    I can not make it work using a MVC app. It fails on init function...

  4. #4
    Ext JS Premium Member twaindev's Avatar
    Join Date
    Sep 2009
    Posts
    223
    Vote Rating
    3
    twaindev is on a distinguished road

      0  

    Default


    Perhaps it's failing because this line
    Code:
    var headerCt = grid.headerCt
    is missing a semi-colon.

    After fixing this it works in my MVC app.

    Here is my version:
    Code:
    /**
    * @class Ext.ux.grid.HeaderToolTip
    * @namespace Ext.ux.grid
    *
    *  Text tooltips should be stored in the grid column definition
    */
    Ext.define('Ext.ux.grid.HeaderToolTip', {
        alias: 'plugin.headertooltip',
    
        init: function (grid) {
            var headerCt = grid.headerCt;
    
            headerCt.on("afterrender", function () {
                grid.tip = Ext.create('Ext.tip.ToolTip', {
                    target: headerCt.el,
                    delegate: ".x-column-header",
                    trackMouse: true,
                    renderTo: Ext.getBody(),
                    listeners: {
                        beforeshow: function (tip) {
                            var c = headerCt.down('gridcolumn[id=' + tip.triggerElement.id + ']');
    
                            if (c) {
                                tip.update(c.tooltip || c.text);
                                return true;
                            }
    
                            return false;
                        }
                    }
                });
            });
        }
    });

  5. #5
    Sencha User
    Join Date
    Dec 2010
    Posts
    16
    Vote Rating
    0
    asmweb is on a distinguished road

      0  

    Default Could manage to make it work

    Could manage to make it work


    Hi there, thank you for your answer but I could manage to make it work by myself. Misstypo problem.

  6. #6
    Sencha User
    Join Date
    Mar 2011
    Posts
    6
    Vote Rating
    0
    c2c-bacardi is on a distinguished road

      0  

    Default Great plugin! One small issue...

    Great plugin! One small issue...


    Right away I experienced an issue where hovering between a column with a tooltip and one without a tooltip would prevent the tooltip from showing again until you mouse out from the header container and mouse back in.

    Adding tip.clearTimers() before returning false in the beforeshow event addressed this issue:

    Code:
    /**
     * @class Ext.ux.grid.HeaderToolTip
     * @namespace ux.grid
     *
     *  Text tooltips should be stored in the grid column definition
     *
     *  Sencha forum url:
     *  http://www.sencha.com/forum/showthread.php?132637-Ext.ux.grid.HeaderToolTip
     */
    Ext.define('Ext.ux.grid.HeaderToolTip', {
        alias: 'plugin.headertooltip',
        init : function(grid) {
            var headerCt = grid.headerCt;
            grid.headerCt.on("afterrender", function(g) {
                grid.tip = Ext.create('Ext.tip.ToolTip', {
                    target: headerCt.el,
                    delegate: ".x-column-header",
                    trackMouse: true,
                    renderTo: Ext.getBody(),
                    listeners: {
                        beforeshow: function(tip) {
                            var c = headerCt.down('gridcolumn[id=' + tip.triggerElement.id  +']');
                            if (c && c.tooltip) {                            
                                tip.update(c.tooltip);
                            } else {
                                tip.clearTimers();
                                return false;
                            }
                        }
                    }
                });
            });
        }
    });

film izle

hd film izle

film sitesi

takipci kazanma sitesi

takipci kazanma sitesi

güzel olan herşey

takipci alma sitesi

komik eğlenceli videolar