首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >ExtJS4 -不显示列值的工具提示

ExtJS4 -不显示列值的工具提示
EN

Stack Overflow用户
提问于 2018-06-08 23:57:33
回答 1查看 49关注 0票数 0

我正在尝试编写一个特定于网格中每一列的工具提示。

我当前的实现无法获取悬停在其上的记录的值。如何引用行条目的具体列/行值?

fiddle

代码

代码语言:javascript
运行
复制
Ext.onReady(function() {
var trackStore = new Ext.data.Store({
  storeId: 'soundCloudStore',

    proxy: {
      type: 'memory',
      data: [
          {
           title: 'Test', duration: '3434', genre: 'stuff', created_at: '2011/06/18', id: '1'   
         }
      ]
    },
    fields:['duration', 'genre', 'created_at', 'title', 'id']
});

trackStore.load(
  function() { 
    Ext.create('Ext.grid.Panel', {
      title: 'Tracks',
      store: trackStore,
      stripeRows: false,
      columns: [
        { 
            header: 'Title', 
            dataIndex: 'title'

        },
        { header: 'Duration',  dataIndex: 'duration' },
        { header: 'Genre', dataIndex: 'genre' },
        { header: 'Created At', dataIndex: 'created_at'}
      ],
      height: 200,
      width: 475,
      renderTo: Ext.getBody(),
      listeners: {
        afterrender: function( )
        {
            view = this.getView();

            view.tip = Ext.create('Ext.tip.ToolTip', {
                target: view.el,
                delegate: view.itemSelector,
                trackMouse: true,
                renderTo: Ext.getBody(),
                listeners: {
                    beforeshow: function updateTipBody(tip) {
                        tip.update(this.data.title);
                    }
                }
            });
        }
    }

  });
});
});

错误

代码语言:javascript
运行
复制
Uncaught TypeError: Cannot read property 'title' of undefined
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/50764386

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档