如何使Acumatica多行PXGridColumn显示新行? [英] How can I make an Acumatica, multiline PXGridColumn display new lines?

查看:72
本文介绍了如何使Acumatica多行PXGridColumn显示新行?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

I am customizing the description field on the Project Quotes form (Screen PM304500). I need the description field to be multi-line and it must preserve new lines.

我已自定义字段本身以允许很长的字符串,并且已自定义了对应的字段具有Multiline = true的PXGridColumn。这样,我就可以编辑字段值,并通过shift输入可以在字符串中插入换行符。此外,grid列在不进行编辑时将在多行上显示该字符串,但是新行将被忽略,就好像该值将显示为HTML一样。我知道换行符会保留下来,因为当我再次编辑值时,换行符就出现了。

I have customized the field itself to allow for very long strings and I have customized the corresponding PXGridColumn with Multiline="true". With this I am able to edit the field value and with shift-enter I am able to insert newlines in the string. Also, the grid column, when not editing, will display the string on multiple lines, but new lines are ignored as if the value is being displayed as HTML. I know the newlines are preserved since, when I again edit the value, the newlines are present.

此外,我已经能够使用Chrome中的开发者控制台进行钻取下降到PXGridColumn的结果。样式为空白:正常。如果将其更改为空白:预包装,则该列将显示为我想要的样子。

Further, I have been able to use the developer console in Chrome to drill down to the that results from the PXGridColumn. That is styled with "white-space: normal". If I change this to "white-space: pre-wrap" the column looks as I want it to.

我还尝试过修改该字段的值来替换带
标记的换行符。不幸的是,当我这样做时,我看到的是值中的文字
而不是换行。

I have also tried munging the value of the field to replace the newlines with
tags. Unfortunately, when I do this, I see the literal "
" in the value rather than a new line.

理想情况下,我只想更改样式在从PXGridColumn到空白:预包装的元素上。 PXGridColumn是否有一个属性/属性可以让我做到这一点?另外,如果我可以将值呈现为HTML,则可以用
方法替换新行。当然,我欢迎其他方法。

Ideally, I would like to just change the styling on the elements that result from the PXGridColumn to "white-space: pre-wrap". Is there an attribute/property for PXGridColumn that will allow me to do that? Alternatively, I would be okay with the replacing new lines with
approach if I could get the value to render as HTML. Of course, I am open to other approaches.

推荐答案

您可以通过以下方式实现:

You can achieve this in the following way:


  1. 复制Acumatica的App_Themes文件夹中的默认文件夹:

  2. 在复制的文件夹中打开00_Controls.css文件,并将下面的css类打开到文件末尾并保存文件

  1. Copy the Default folder in the App_Themes folder of Acumatica:
  2. Open 00_Controls.css file in the copied folder and the css class below to the end of the file and save the file

.MyTable table:not([class~=GridRowForm]) tbody tr td{
    white-space: pre-wrap !important;
}


  • 在屏幕编辑器中,选择要具有白色的网格-space css样式已应用,并将MyTable添加为CssStyle。

  • In the Screen Editor select the Grid you want to have that white-space css style applied and add MyTable as CssStyle.

    现在转到网站偏好设置(SM200505)页面,然后选择默认-复制为界面主题

    Now go to Site Preferences(SM200505) page and select Default - Copy as Interface Theme

    这些步骤之后,您应该能够在销售订单明细中获得以下用户界面:

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

    这篇关于如何使Acumatica多行PXGridColumn显示新行?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

  • 查看全文
    登录 关闭
    扫码关注1秒登录
    发送“验证码”获取 | 15天全站免登陆