EXTJS4:如何为grid某一个单元格增加提示框


测试环境 ext-4.1.0-gpl

运行效果:

 

Ext.onReady(function () {    
    Ext.tip.QuickTipManager.init(); 
    Ext.widget('grid', {
        title: 'Users',
        store: {
            fields: ['name', 'email', 'comment'],
            data: [
                { 'name': 'Lisa', 'email': 'lisa@simpsons.com', 'comment': 'some comment' },
                { 'name': 'Bart', 'email': 'bart@simpsons.com', 'comment': 'comment' },
                { 'name': 'Homer', 'email': 'home@simpsons.com', 'comment': 'some very long comment' },
                { 'name': 'Marge', 'email': 'marge@simpsons.com', 'comment': 'some very very very very long comment' }
            ]
        },
        columns: [
            { header: 'Name', dataIndex: 'name', width: 100 },
            { header: 'Email', dataIndex: 'email', width: 150 },
            {
                header: 'comment',
                dataIndex: 'comment',
                flex: 1,
          ///////////////////////////////////////////////////////////////////// renderer:
function (value, meta, record) { var max = 15; meta.tdAttr = 'data-qtip="' + value + '"'; return value.length < max ? value : value.substring(0, max - 3) + '...'; }
          ////////////////////////////////////////////////////////////////////// } ], width:
400, renderTo: Ext.getBody() }); });

 

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM