代码之家  ›  专栏  ›  技术社区  ›  Dane

Acumatica-根据图像设置网格行高度

  •  0
  • Dane  · 技术社区  · 7 年前

    我已将缩略图添加到销售订单行网格中。这将显示附加到库存项目的图像。您可以在这里看到这种定制: Acumatica - Adding Image in Sales Order Line 但是,客户系统中当前的图像非常大。所以销售订单的数量非常大。有没有一种方法可以降低这个高度,但仍然显示整个图像?可能是在ThumbnailURL单元格中包含了什么?我以前在Acumatica中没有使用过网格的CSS样式,所以我不确定从哪里开始,或者这是否是正确的方向。任何帮助都将不胜感激。

    1 回复  |  直到 7 年前
        1
  •  4
  •   Viktor    7 年前

    在定制中,向表单添加javascript元素。请注意,这很棘手,有时在保存之前不会显示。然后将以下脚本添加到其源代码中。

    var css = '.GridRow > img { width: 40px; height: 40px; }',
    head = document.head || document.getElementsByTagName('head')[0],
    style = document.createElement('style');
    style.type = 'text/css';
    if (style.styleSheet){
      style.styleSheet.cssText = css;
    } else {
    style.appendChild(document.createTextNode(css));
    }
    
    head.appendChild(style);
    

    Customization screen

    然后网格中的所有图像将缩放到40x40像素。

    Final result

    You can download the example here

    推荐文章