我有以下用例:如何在Acumatica屏幕中有條件地隱藏PXPanel?
Acumatica下拉菜單,它可以有2個左右的值。
例如:
- 如果用戶選擇選項,我需要顯示PXPanel(ID = 「PANEL1」)
- 如果用戶選擇選項B,I需要顯示PXPanel(ID =「是Panel2 「)
那些PXPanels是裏面一個PXFormView,讓他們有一個數據成員像這樣:
<px:PXFormView ID="form" runat="server" DataSourceID="ds" DataMember="Waybills">
<px:PXPanel ID="panel1" ..
<px:PXPanel ID="panel2" ..
</px:PXFormView>
是否可以有條件地顯示/隱藏PXPanels?
正如RuslanDev所說,我可以用PXLayoutRule(GroupCaption)實現同樣的效果,但在這種情況下,我無法將標題設置爲100%,它等於第一列的寬度。
隨着PXPanel:
<px:PXPanel ID="panel3" runat="server" Caption="Buyer (Receiver)" RenderStyle="Fieldset" AlreadyLocalized="False" DataMember="" >
<px:PXLayoutRule runat="server" StartRow="True" StartColumn="True" ColumnWidth="XM" />
<px:PXSegmentMask CommitChanges="True" ID="edCustomerID" runat="server" DataField="CustomerID" DataSourceID="ds" />
<px:PXLayoutRule runat="server" StartRow="True" StartColumn="True" ColumnWidth="XM" />
<px:PXTextEdit ID="edRecipientTaxRegistrationID" runat="server" DataField="RecipientTaxRegistrationID" Enabled="False" CommitChanges="True" AlreadyLocalized="False" DefaultLocale="" />
<px:PXCheckBox ID="edRecipientIsForeignCitizen" runat="server" DataField="RecipientIsForeignCitizen" AlreadyLocalized="False" Enabled="false"/>
<px:PXLayoutRule runat="server" StartColumn="True" ColumnWidth="XM" />
<px:PXTextEdit ID="edRecipientName" runat="server" DataField="RecipientName" Enabled="False" AlreadyLocalized="False" DefaultLocale="" />
<px:PXLayoutRule runat="server" StartColumn="True" ColumnWidth="XM" />
<px:PXTextEdit ID="edRecipientDestinationAddress" runat="server" DataField="RecipientDestinationAddress" CommitChanges="True" AlreadyLocalized="False" DefaultLocale="" />
</px:PXPanel>
隨着PXLayoutRule:
apsx:
<px:PXLayoutRule runat="server" StartRow="True" StartColumn="True" GroupCaption="Buyer (Receiver)" StartGroup="true" ColumnSpan="3"/>
<px:PXLayoutRule runat="server" StartColumn="True" ColumnWidth="XM" />
<px:PXSegmentMask CommitChanges="True" ID="edCustomerID" runat="server" DataField="CustomerID" DataSourceID="ds" />
<px:PXLayoutRule runat="server" StartRow="True" StartColumn="True" ColumnWidth="XM" />
<px:PXTextEdit ID="edRecipientTaxRegistrationID" runat="server" DataField="RecipientTaxRegistrationID" Enabled="False" CommitChanges="True" AlreadyLocalized="False" DefaultLocale="" />
<px:PXCheckBox ID="edRecipientIsForeignCitizen" runat="server" DataField="RecipientIsForeignCitizen" AlreadyLocalized="False" Enabled="false"/>
<px:PXLayoutRule runat="server" StartColumn="True" ColumnWidth="XM" />
<px:PXTextEdit ID="edRecipientName" runat="server" DataField="RecipientName" Enabled="False" AlreadyLocalized="False" DefaultLocale="" />
<px:PXLayoutRule runat="server" StartColumn="True" ColumnWidth="XM" />
<px:PXTextEdit ID="edRecipientDestinationAddress" runat="server" DataField="RecipientDestinationAddress" CommitChanges="True" AlreadyLocalized="False" DefaultLocale="" />
我確實,但面板標題仍然存在。我也想隱藏該標題 – user3857731
您是否嘗試過使用PXLayoutRule而不是PXPanel?我相信與GroupCaption屬性指定的PXLayoutRule應該看起來相同PXPanel – RuslanDev
我做了,它的工作原理,但我面臨其他問題。我不能將PXLayoutRule設置爲100%或者例如colspan 3 ... – user3857731