简体   繁体   English

如何在Dynamics AX 4.0中显示工具提示?

[英]How to display a tooltip in Dynamics AX 4.0?

I'm looking to add hover text to a given column in a grid with row specific data. 我正在寻找将悬停文本添加到具有行特定数据的网格中的给定列。 I'm planning on overriding the mouse-enter event, but I'm unsure how to populate a Tooltip and have it display next to the mouse. 我正在计划覆盖鼠标输入事件,但是我不确定如何填充工具提示并将其显示在鼠标旁边。

Any direction would be appreciated, thanks! 任何方向将不胜感激,谢谢!

**Edit: It looks like the method to override is actually called "Tooltip". **编辑:似乎要覆盖的方法实际上称为“工具提示”。 I was able to override this and get a tooltip to display. 我能够覆盖它并获得显示的工具提示。

The question remains: How to access the current row's data for the column that the Tooltip is on? 问题仍然存在:如何访问工具提示所在的列的当前行数据?

To show a tooltip with the description of the foreign key field, the following must be met: 要显示带有外键字段描述的工具提示,必须满足以下条件:

  1. Base your field on an extended data type 将字段基于扩展数据类型
  2. Put a relation on the extended data type 将关系放在扩展数据类型上
  3. Have the relation point to a base table 将关系点指向基表
  4. Set the TitleField1 and TitleField2 attributes on the base table 在基表上设置TitleField1TitleField2属性
  5. Have a unique index on the key fields of your base table 在基表的关键字段上具有唯一索引

You can put the relation on the (transaction) table instead of the extended data type. 您可以将关系放在(事务)表上,而不是扩展数据类型上。 Do that in AX 2012 or if the relation has more than one field to join. 在AX 2012中或者如果该关系有多个要加入的字段,请执行此操作。

Here's the tooltip code that I ended up using: 这是我最终使用的工具提示代码:

public str toolTip()
{
    ;
    return tblYourTable::find(this.value()).Description;
}

**Edit per Jan's comment to greatly simplify code **根据Jan的评论进行编辑,以大大简化代码

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM