html [ArasLabs / custom-form-css] item_info字段的自定义内容

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了html [ArasLabs / custom-form-css] item_info字段的自定义内容相关的知识,希望对你有一定的参考价值。

<span id="ITEM_INFO_INTERNAL_SPAN" class="info_group" style="display:block;"></span>

<script> 
  populate_ITEM_INFO_INTERNAL_SPAN = function()
  {
    document.getElementById("ITEM_INFO_INTERNAL_SPAN").innerHTML = top.aras.uiDrawItemInfoTable(document.itemType);
    top.aras.uiPopulateInfoTableWithItem(document.item, document);

    // apply customizations in separate function
    style_ITEM_INFO_INTERNAL_SPAN();
  }

  style_ITEM_INFO_INTERNAL_SPAN = function()
  {
    // override default icon style
    var lg_icn = document.getElementById("large_icon_img");
    lg_icn.style = '';

    var tbl = document.getElementById("itemInfoTable");
    tbl.style.marginTop = "45px";

    // add element to display styled state
    var container = document.getElementById("ITEM_INFO_INTERNAL_SPAN");
    var stateLabel = document.createElement("span");
    stateLabel.className = "my_state";
    container.appendChild(stateLabel);

    // set value of new state element
    var stateValue = document.getElementById("itemProps$state");
    stateValue = stateValue.textContent;
    stateLabel.innerHTML = stateValue.toUpperCase();

    // style new state element color based on LC state
    if (stateValue == "Released")
        stateLabel.style.color = "red"; 

    if (stateValue == "Preliminary")
        stateLabel.style.color = "green"; 

    // hide default state property in table
    var stateRow = document.getElementById("state_row");
    stateRow.style.visibility = "hidden";
    stateRow.style.display = "none";

    // display classification as title
    var thisItem = document.thisItem;
    var classification = thisItem.getProperty("classification","Part");
    var titleEl = document.getElementById("label_span");
    titleEl.innerHTML = classification;
  }

// populate item_info table onLoad
window.addEventListener("load", populate_ITEM_INFO_INTERNAL_SPAN);

</script>

以上是关于html [ArasLabs / custom-form-css] item_info字段的自定义内容的主要内容,如果未能解决你的问题,请参考以下文章

css [ArasLabs / custom-form-css]定义字段集的样式

css [ArasLabs / custom-form-css]导入表单的自定义CSS文件

csharp [ArasLabs / override-default-structure-browser]显示零件,文档和CAD的分类属性

css [ArasLabs / custom-form-css]用于自定义item_info字段内容的CSS

css 来自myStyles.css的[ArasLabs / custom-form-css]片段,显示应用于myIcon的样式

csharp [ArasLabs / override-default-structure-browser]将分类属性添加到与上下文项相同类型的项中