编辑备用提示消息
我正在尝试为单列的 2 个单元格设置 2 个不同的工具提示消息,但在运行时将应用单个提示消息,即如果我根据 if 子句的条件单击单元格,则相同的提示消息将被转发到其余部分在单元格中,如果我从第一个单元格导航到第二个单元格,则消息不会更改,第一个单元格消息将继续下去,反之亦然,如果我从第二个单元格移动到第一个单元格,则第二个提示消息将与其余单元格保持相同。
celldblclick : function(grid, rowIndex, columnIndex, e) {
var ed = grid.getColumnModel().getCellEditor(columnIndex,rowIndex) || {};
ed = ed.field || {};
if (rowIndex == 0 && columnIndex == 2) {
ed.qtipText="SAMPLE1";
} else {
ed.qtipText="SAMPLE2";
}
}
I am trying to set 2 different tool tip message for 2 cells of single column,but on run time single tip message will be applied that is if am clicking on cell with respect to condition of if clause then same tip message will be forwarded to rest of the cells,if i navigate from 1 st cell to 2 cell message will not change 1 st cell message will carry forwards and vise versa if i move from 2nd cell to 1 cell 2nd tip message will remain same for rest of the cells.
celldblclick : function(grid, rowIndex, columnIndex, e) {
var ed = grid.getColumnModel().getCellEditor(columnIndex,rowIndex) || {};
ed = ed.field || {};
if (rowIndex == 0 && columnIndex == 2) {
ed.qtipText="SAMPLE1";
} else {
ed.qtipText="SAMPLE2";
}
}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
为了让它们以不同的方式显示,我通常将一个函数附加到工具提示
beforeshow
方法,该函数在显示工具提示之前更新工具提示:在上面的示例中,我为数据存储本身中的每个记录定义了工具提示,即这就是为什么我调用
text = view.getRecord(tip.triggerElement).get('tooltip')
('tooltip' 是我的数据存储中包含工具提示文本的列)。但是您可以在 beforeshow 侦听器函数中实现您想要的任何逻辑,只要您在最后调用tip.update(yourLogic)
即可。To get them to display differently I normally attach a function to the tooltip
beforeshow
method which updates the tooltip before it is displayed:In the above example I had my tooltips defined for each record in the datastore itself, that is why I call
text = view.getRecord(tip.triggerElement).get('tooltip')
('tooltip' is the column in my datastore with the tooltip text). But you could implement whatever logic you want in the beforeshow listener function as long as you calltip.update(yourLogic)
at the end.