如何创建具有样式作为“库存项目的描述”选项卡的新选项卡? [英] How to create new tab that has style as Description tab for Stock Items?

查看:42
本文介绍了如何创建具有样式作为“库存项目的描述”选项卡的新选项卡?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想创建一个新标签(软件解决方案)并添加与描述标签相同的新字段(解决方案),以允许用户添加一些描述。

I want to create new tab (Software Solution) and add new field (Solution) that is the same as Description tab to allow users put some description.

< a href = https://i.stack.imgur.com/20KZ7.jpg rel = nofollow noreferrer>

这就是我所做的。

推荐答案

您需要使用PXRichTextEdit控件来实现。自定义设计将不允许您选择此控件类型,因此您可能需要直接手动编辑ASPX文件以添加PXRichTextEdit。在布局编辑器中,选择操作->编辑Aspx,然后手动修改ASPX以添加新控件。然后,您可以单击生成定制脚本按钮来更新定制项目。

You need to use the PXRichTextEdit control to achieve that. The customization design will not allow you to pick this control type, so you will likely need to manually edit the ASPX file directly to add a PXRichTextEdit. From the layout editor, select Actions->Edit Aspx, and manually modify the ASPX to add your new control. You can then click the Generate Customization Script button to update the customization project.

这是ASPX中描述选项卡的外观:

This is how the Description tab looks like in the ASPX:

            <px:PXTabItem Text="Description" LoadOnDemand="true" >
                <Template>
                    <px:PXRichTextEdit ID="edMyField" runat="server" DataField="UsrMyField">
                        <AutoSize Enabled="True" MinHeight="216" />
                    </px:PXRichTextEdit>
                </Template>
            </px:PXTabItem>

基础数据库字段需要为nvarchar(max)字段,而DAC属性需要用PXDBText(IsUnicode = true)属性。如果使用PXDBString,则内容将不会保存。

The underlying database field needs to a nvarchar(max) field and the DAC property needs to be decorated with the PXDBText(IsUnicode=true) attribute. If you use PXDBString, the content will not save.

不幸的是,Customization Projects附带的数据库架构工具不允许您添加nvarchar(max)字段(最大支持的最大长度为4000),这还不够。您可以改用以下T-SQL脚本并将其添加到自定义项目中:

Unfortunately, the database schema tool included with Customization Projects does not allow you to add nvarchar(max) fields (the maximum length supported is 4000) and this is not enough. You can use the following T-SQL script instead and add it to the customization project:

IF NOT EXISTS (
  SELECT * 
  FROM   sys.columns 
  WHERE  object_id = OBJECT_ID(N'[dbo].[Contact]') 
         AND name = 'UsrMyField'
)
BEGIN
    ALTER TABLE [dbo].[Contact] ADD [UsrMyField] nvarchar(max)
END

这篇关于如何创建具有样式作为“库存项目的描述”选项卡的新选项卡?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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