zoukankan      html  css  js  c++  java
  • 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',  100 },
                { header: 'Email', dataIndex: 'email',  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) + '...'; }
              ////////////////////////////////////////////////////////////////////// } ],
    400, renderTo: Ext.getBody() }); });

     

  • 相关阅读:
    hdu_5791_Two(DP)
    hdu_5783_Divide the Sequence(贪心)
    hdu_5769_Substring(后缀数组)
    hdu_5778_abs(暴力)
    hdu_5776_sum(前缀和维护)
    hdu_5777_domino(贪心)
    [wikioi2069]油画(贪心)
    [bzoj 1503][NOI 2004]郁闷的出纳员(平衡树)
    数据结构练习
    [poj3274]排排站(Hash)
  • 原文地址:https://www.cnblogs.com/zdkjob/p/2719708.html
Copyright © 2011-2022 走看看