我有这样的actioncolumn:
{
xtype: 'actioncolumn',
align: 'center',
items: [
{
getTip: function () {
return 'this doesn\'t work';
},
handler: function() {
// action 1
}
},{
tooltip: 'works',
handler: function() {
// action 2
}
}
]
}
Run Code Online (Sandbox Code Playgroud)
我在文档中找到的getTip()方法,但它不起作用或者我不知道如何使用它.我做错了什么或如何设置工具提示?
正如 bjornd 所说,这似乎是 getTip() 的错误,但我成功添加了工具提示,这不是我认为的最好方法,但它对我有用。
{
xtype: 'actioncolumn',
align: 'center',
items: [
{
getClass: function(value,meta,record,rowIx,colIx, store) {
this.items[0].tooltip = 'working ' + record('name');
return 'some-class-name'; // or something if needed
},
handler: function() {
// action 1
}
},{
tooltip: 'works',
handler: function() {
// action 2
}
}
]
}
Run Code Online (Sandbox Code Playgroud)
如果有人可以提出更好的解决方案,我将很高兴听到。