微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

javascript – Extjs 4 grid mouseover显示全单元格值

我在其中一列有一个长字符串的网格.当用户将鼠标悬停在此列中的任何单元格时,我希望出现完整的字符串.

到目前为止,我有一个工具提示弹出此列中的任何单元格,但它们不显示文本.工具提示总是只是说“图标提示”.

如何让qtip显示变量val而不是字符串“Icon Tip”?

Ext.define('AM.view.user.List',{
    extend: 'Ext.grid.Panel',.......
    initComponent: function() {
        function renderTip(val,Meta,rec,rowIndex,colIndex,store) {
            Meta.tdAttr = 'data-qtip="Icon Tip"';
            return val;
        };
        this.columns = [
            {header: 'First Name',dataIndex: 'FirstName',width: 75},{header: 'Last Name',dataIndex: 'Last',{header: 'Perm',dataIndex: 'Perm',{header: 'Comment',dataIndex: 'Comments',width: 150,renderer: renderTip}
        ];
        this.callParent(arguments);
    }
});

解决方法

在sencha论坛上看出,正确的代码将是:
function renderTip(value,MetaData,record,rowIdx,colIdx,store) {
    MetaData.tdAttr = 'data-qtip="' + value + '"';
    return value;
};

我想有一些字符串/变量连接我需要使用

http://www.sencha.com/forum/showthread.php?179016-Grid-cell-tooltip

原文地址:https://www.jb51.cc/js/155439.html

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。

相关推荐