我有一个带有多个自定义按钮的窗体,这些按钮由于多种原因而被启用/禁用,每个按钮都由作为custom Ribbon Enable Rule的一部分调用的Javascript函数确定。作为启用规则JavaScript的一部分,我想更新按钮被禁用的悬停文本:“此记录缺少Yada”、“您没有访问权限”等。
当前的默认消息是“您可能尚未选择使用此功能的项目。如果您没有使用此功能的权限,请与您的系统管理员联系。”
是否可以从启用规则中对其进行更新?(是的,我知道它将不受支持)如果是,如何支持?
我猜我会使用JQuery,但我不太熟悉选择器来选择那个div…
<span
class="ms-cui-tooltip"
id="new_inquiry|NoRelationship|Form|NEWNEW.Form.itt_inquiry.MainTab.MoveTo.StudentMovement_ToolTip"
role="tooltip"
aria-hidden="true"
style="left: 405px; top: 135px; visibility: hidden; position: absolute; min-width: 210px;"
unselectable="on">
<div class="ms-cui-tooltip-body" unselectable="on">
<div class="ms-cui-tooltip-glow" unselectable="on">
<h1 unselectable="on">Movement</h1>
<div class="ms-cui-tooltip-description" unselectable="on">Movement Description</div>
<div class="ms-cui-tooltip-clear" unselectable="on"></div>
<hr unselectable="on">
<div class="ms-cui-tooltip-footer" unselectable="on">
<span class=" ms-cui-img-16by16 ms-cui-img-cont-float" style="vertical-align: top;" unselectable="on"></span>
<div unselectable="on">This button is currently disabled.</div>
</div>
<div class="ms-cui-tooltip-description" style="width: 90%;" unselectable="on">
You may not have selected the item that works with this feature. If you do not have permissions to use this feature, contact your system administrator.
</div>
</div>
</div>
</span>发布于 2014-04-17 21:55:34
您可以使用类似以下内容的内容:
var btnId = "new_inquiry|NoRelationship|Form|NEWNEW.Form.itt_inquiry.MainTab.MoveTo.StudentMovement_ToolTip";
var btnCls = "ms-cui-tooltip-description"";
var newText = "New button description";
$("#" + btnId + "." + btnCls, window.parent).text(newText);这将在父(功能区)窗口中查找具有特定id和类的元素,并更改其文本;虽然未经过测试,但您可能需要对其进行一些调整。
https://stackoverflow.com/questions/23114490
复制相似问题