ale*_*311 10 javascript grid javascript-framework extjs4
我在其中一列中有一个长字符串的网格.当用户将鼠标悬停在此列中的任何单元格上时,我希望显示完整的字符串.
到目前为止,我已经使用了工具提示弹出此列中的任何单元格,但它们不显示文本.工具提示总是只是说"图标提示".
如何让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', width: 75},
{header: 'Perm', dataIndex: 'Perm', width: 75},
{header: 'Comment', dataIndex: 'Comments', width: 150, renderer: renderTip}
];
this.callParent(arguments);
}
});
Run Code Online (Sandbox Code Playgroud)
ale*_*311 13
在sencha论坛上找出来,正确的代码是:
function renderTip(value, metaData, record, rowIdx, colIdx, store) {
metaData.tdAttr = 'data-qtip="' + value + '"';
return value;
};
Run Code Online (Sandbox Code Playgroud)
我想我需要使用一些字符串/变量连接
http://www.sencha.com/forum/showthread.php?179016-Grid-cell-tooltip
| 归档时间: |
|
| 查看次数: |
12352 次 |
| 最近记录: |