0 0

Ext 中 grid 怎么 对 鼠标滑过每一行 设置一个提示信息?3

就比如说 table 中 当鼠标滑过每一行  都有提示信息
<tr title="aaaa提示 信息">
</tr>

在 html 中 好实现 在 ext grid 里  怎么弄啊?
2009年6月29日 19:06

5个答案 按时间排序 按投票排序

0 0

采纳的答案

在列映射的时候就要设定渲染方式

var colModel = new Ext.grid.ColumnModel([
    { header: "$ Sales", width: 100, sortable: true, renderer: heihei} 
 ]);


渲染的函数写成如下:

function heihei(value, meta, rec, rowIdx, colIdx, ds){
    return '<div ext:qtitle="" ext:qtip="' + value + '">'+ value +'</div>';
}


顶部需要加入
Ext.QuickTips.init();


qtitle代表tip的标题, qtip代表内容。这时鼠标划过就会出现提示!

2009年6月29日 22:47
0 0

似乎发错了,
http://atian25.iteye.com/blog/417361

2009年6月30日 09:48
0 0

关于行提示的,
如果在2.2需要重写一些方法,如果是3.0就简单多了.
详见:http://atian25.iteye.com/admin/blogs/417361

2009年6月30日 09:31
0 0

官方FAQ里面已经有详细的几种做法说明:
http://extjs.com/learn/Ext_FAQ_Grid#Add_ToolTip_or_Qtip

不过都是celltip,而不是rowtip



另外,3.0对column的doc里面有描述了一个tooltip,是对某一列批量设置的,不能改变:

Class Ext.grid.Column

tooltip : String

A text string to use as the column header's tooltip. If Quicktips are enabled, this value will be used as the text of the quick tip, otherwise it will be set as the header's HTML title attribute. Defaults to ''.

2009年6月29日 22:51
0 0

Ext.grid.ColumnModel

   /**
     * Returns the tooltip for the specified column.
     * @param {Number} col The column index
     * @return {String}
     */
    getColumnTooltip : function(col){
            return this.config[col].tooltip;
    },
    /**
     * Sets the tooltip for a column.
     * @param {Number} col The column index
     * @param {String} tooltip The new tooltip
     */
    setColumnTooltip : function(col, tooltip){
            this.config[col].tooltip = tooltip;
    },

2009年6月29日 19:24

相关推荐

Global site tag (gtag.js) - Google Analytics