Dynamics CRM JS 隐藏子网格“+”号(不推荐,随笔记录)

发布时间:2022-06-29 发布网站:脚本宝典
脚本宝典收集整理的这篇文章主要介绍了Dynamics CRM JS 隐藏子网格“+”号(不推荐,随笔记录)脚本宝典觉得挺不错的,现在分享给大家,也给大家做个参考。

 

 

调用示例代码:

 hideAddButton(window, "tab_approval_process,nextcustomer,billTo,account_attachment");

 

function hideAddButton(w, subgrids) {
    ///<summary>隐藏子网格加号按钮</summary>
    /// <param name="w">window对象</param>
    /// <param name="subgrids">子网格名称,多个英文逗号隔开</param>
  var subgrid = subgrids.split(',');
    for (var i = 0; i < subgrid.length; i++) {
        var _id = subgrid[i] + "_contextualButtonsContainer";      var _button = w.document.getElementById(_id);
        if ((_button == null || _button == undefined) && window.parent != null && window.parent != undefined) {
            _button = w.parent.window.document.getElementById(_id);
        }
        if (_button != undefined && _button != null) {
            _button.style.display = "none";
        }
    }
}

 

 

function hideAddButton(w, subgrids) {    ///<summary>隐藏子网格加号按钮</summary>    /// <param name="w">window对象</param>    /// <param name="subgrids">子网格名称,多个英文逗号隔开</param>    console.log("w=" + w);    console.log("subgrids=" + subgrids);    var subgrid = subgrids.split(',');    for (var i = 0; i < subgrid.length; i++) {        var _id = subgrid[i] + "_contextualButtonsContainer";        console.log("ID=" + subgrid[i] + ",i=" + i);        var _button = w.document.getElementById(_id);        if ((_button == null || _button == undefined) && window.parent != null && window.parent != undefined) {            _button = w.parent.window.document.getElementById(_id);        }        if (_button != undefined && _button != null) {            _button.style.display = "none";            console.log("ID=" + _id + ",Display=" + _button.style.display);        }    }}

脚本宝典总结

以上是脚本宝典为你收集整理的Dynamics CRM JS 隐藏子网格“+”号(不推荐,随笔记录)全部内容,希望文章能够帮你解决Dynamics CRM JS 隐藏子网格“+”号(不推荐,随笔记录)所遇到的问题。

如果觉得脚本宝典网站内容还不错,欢迎将脚本宝典推荐好友。

本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。
标签: