如何使 Acumatica 多行 PXGridColumn 显示新行?

2023-12-10

我正在自定义项目报价表单(屏幕 PM304500)上的描述字段。我需要描述字段是多行的,并且它必须保留新行。

我已经自定义了字段本身以允许非常长的字符串,并且我已经使用 Multiline="true" 自定义了相应的 PXGridColumn。这样我就可以编辑字段值,并且使用shift-enter我可以在字符串中插入换行符。此外,网格列在不进行编辑时会在多行上显示字符串,但新行将被忽略,就像该值显示为 HTML 一样。我知道换行符会被保留,因为当我再次编辑该值时,换行符会出现。

此外,我已经能够使用 Chrome 中的开发人员控制台深入了解 PXGridColumn 的结果。其样式为“空白:正常”。如果我将其更改为“空白:预换行”,则该列看起来就像我想要的那样。

我还尝试修改该字段的值以替换换行符
标签。不幸的是,当我这样做时,我看到了字面意思“
" 在值中而不是新行中。

理想情况下,我只想将 PXGridColumn 生成的元素的样式更改为“white-space: pre-wrap”。 PXGridColumn 是否有一个属性/属性可以让我这样做?或者,我可以用以下内容替换新行
方法,如果我可以获得呈现为 HTML 的值。当然,我对其他方法持开放态度。


您可以通过以下方式实现此目的:

  1. Copy the Default folder in the App_Themes folder of Acumatica: enter image description here
  2. 打开复制的文件夹中的00_Controls.css文件以及下面的css类到文件末尾并保存文件

    .MyTable table:not([class~=GridRowForm]) tbody tr td{
        white-space: pre-wrap !important;
    }
    
  3. In the Screen Editor select the Grid you want to have that white-space css style applied and add MyTable as CssStyle. enter image description here

  4. Now go to Site Preferences(SM200505) page and select Default - Copy as Interface Theme enter image description here

After these steps, you should be able to get the following UI in Sales Orders Details: enter image description here

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

如何使 Acumatica 多行 PXGridColumn 显示新行? 的相关文章

随机推荐