Extjs4在gridPanel中的每个列悬停上设置工具提示 [英] Extjs4 set tooltip on each column hover in gridPanel

查看:347
本文介绍了Extjs4在gridPanel中的每个列悬停上设置工具提示的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在当前列的每一行上都获得了鼠标悬停的工具提示,但是在同一行上继续悬停时却无法获得下一列的工具提示.

I am getting tooltip on mouse hover by each row for current column but I am unable to get next column tooltip on continue hover on same row.

但是如果我将鼠标悬停在另一行&再次使用以下命令将鼠标悬停在上一行的任何列上:

But I can get it if I hover on another row & again hover any column of the previous row by using:

listeners:{
'itemmouseenter': function (view, record, item, index, e, eOpts) {
        var gridColums = view.getGridColumns();
        var column = gridColums[e.getTarget(this.view.cellSelector).cellIndex];
        Ext.fly(item).set({ 'data-qtip': 'Des:' + column.dataIndex });

  }
}

任何人都可以告诉我我所缺少的内容或为我指明正确的方向吗?

Can anyone show me what I'm missing or point me in the right direction?

推荐答案

我正在仔细研究.我可以通过执行以下操作来获取每个单元的工具提示:

I was looking through this. I could manage to get the tool tip for each cell by doing something like this:

 Ext.getCmp('DynamicDemandGrid').getView().on('render', function(view) {
    view.tip = Ext.create('Ext.tip.ToolTip', {
        // The overall target element.
        target: view.el,
        // Each grid row causes its own seperate show and hide.
        delegate: view.cellSelector,
        // Moving within the row should not hide the tip.
        trackMouse: true,
        // Render immediately so that tip.body can be referenced prior to the first show.
        renderTo: Ext.getBody(),
        listeners: {
            // Change content dynamically depending on which element triggered the show.
            beforeshow: function updateTipBody(tip) {
                var gridColums = view.getGridColumns();
                var column = gridColums[tip.triggerElement.cellIndex];
                var val=view.getRecord(tip.triggerElement.parentNode).get(column.dataIndex);
                tip.update(val);
            }
        }
    });
});

让我知道是否有帮助

这篇关于Extjs4在gridPanel中的每个列悬停上设置工具提示的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆