如何根据页面上子网格的当前行在智能面板刷新中创建网格?
How do I make a grid in a smart panel refresh based on the current row of my child grid on the page?
我有一个标准表单选项卡屏幕,第一个选项卡上有一个网格。该表单通过库存 ID 标识工具。网格标识了可供使用的具有该 ID 的各个工具。由于该工具可以借出和归还,就像旧的视频租赁店租用 DVD 和 VHS 磁带一样,我需要查看该工具所在位置的历史记录。通常,每个库存 ID 只有几个工具。然而,结帐历史可能相当长。我想在智能面板中显示该历史记录,但是当我更改网格的行、选择不同的物理单位时,我无法让智能面板更新。
如何让智能面板网格根据主屏幕的当前网格行进行刷新?
我的网格操作栏按钮定义为:
<px:PXToolBarButton Text="History" DependOnGrid="CstPXGrid7" >
<AutoCallBack Command="viewHistory" Target="ds" >
<Behavior PostData="Page" CommitChanges="True" ></Behavior>
</AutoCallBack>
</px:PXToolBarButton>
智能面板定义为:
<px:PXSmartPanel
runat="server"
ID="PnlSSCSHistory"
CommandSourceID="ds"
Caption="History"
CaptionVisible="True"
Height="400px"
Width="800px"
LoadOnDemand="true"
Key="History"
>
<px:PXGrid AllowPaging="True" Width="100%" DataSourceID="ds" SkinID="Inquire" runat="server" ID="CstPXGrid34">
<Levels>
<px:PXGridLevel DataMember="History" >
<Columns>
<px:PXGridColumn DataField="ToolNbr" Width="140" ></px:PXGridColumn>
<px:PXGridColumn DataField="RequesterID" Width="70" ></px:PXGridColumn>
<px:PXGridColumn DataField="CustomerLocationID" Width="70" ></px:PXGridColumn>
<px:PXGridColumn DataField="DateOut" Width="90" ></px:PXGridColumn>
<px:PXGridColumn DataField="DateDue" Width="90" ></px:PXGridColumn>
<px:PXGridColumn DataField="DateIn" Width="90" ></px:PXGridColumn>
</Columns>
</px:PXGridLevel>
</Levels>
<AutoSize Enabled="True" ></AutoSize>
</px:PXGrid>
<px:PXPanel runat="server" ID="CstPanelSSCS3" SkinID="Buttons">
<px:PXButton runat="server" ID="CstHistory" DialogResult="OK" Text="OK" CommandSourceID="ds" ></px:PXButton>
</px:PXPanel>
</px:PXSmartPanel>
如您在屏幕截图中所见,工具 #2 已被选中,但智能面板中的历史记录仍显示为工具 #1。然而,作为一项临时措施,我在主页上添加了一个辅助网格,它通过将以下内容添加到列出每个工具编号的主网格中来显示正确工具的历史记录。我在主页上的临时历史网格是 CstPXGrid38。在此处添加智能面板的控件 ID 不会像在主屏幕上更新历史网格那样更新智能面板的网格。
<AutoCallBack Command="Refresh" Target="CstPXGrid38" ActiveBehavior="true">
<Behavior RepaintControlsIDs="CstPXGrid38" ></Behavior>
</AutoCallBack>
实现所需功能的 PXSmarPanel 的通用声明应如下所示:
<px:PXSmartPanel ID="GridPanel" runat="server" Height="550px" Width="873px" Caption="My Fancy Grid refresh panel" CaptionVisible="True" Key="GridPanelView" AutoCallBack-Command="Refresh" AutoCallBack-Target="gridPanel" CreateOnDemand="True">
其中“gridPanel”是面板网格的 ID。
我有一个标准表单选项卡屏幕,第一个选项卡上有一个网格。该表单通过库存 ID 标识工具。网格标识了可供使用的具有该 ID 的各个工具。由于该工具可以借出和归还,就像旧的视频租赁店租用 DVD 和 VHS 磁带一样,我需要查看该工具所在位置的历史记录。通常,每个库存 ID 只有几个工具。然而,结帐历史可能相当长。我想在智能面板中显示该历史记录,但是当我更改网格的行、选择不同的物理单位时,我无法让智能面板更新。
如何让智能面板网格根据主屏幕的当前网格行进行刷新?
我的网格操作栏按钮定义为:
<px:PXToolBarButton Text="History" DependOnGrid="CstPXGrid7" >
<AutoCallBack Command="viewHistory" Target="ds" >
<Behavior PostData="Page" CommitChanges="True" ></Behavior>
</AutoCallBack>
</px:PXToolBarButton>
智能面板定义为:
<px:PXSmartPanel
runat="server"
ID="PnlSSCSHistory"
CommandSourceID="ds"
Caption="History"
CaptionVisible="True"
Height="400px"
Width="800px"
LoadOnDemand="true"
Key="History"
>
<px:PXGrid AllowPaging="True" Width="100%" DataSourceID="ds" SkinID="Inquire" runat="server" ID="CstPXGrid34">
<Levels>
<px:PXGridLevel DataMember="History" >
<Columns>
<px:PXGridColumn DataField="ToolNbr" Width="140" ></px:PXGridColumn>
<px:PXGridColumn DataField="RequesterID" Width="70" ></px:PXGridColumn>
<px:PXGridColumn DataField="CustomerLocationID" Width="70" ></px:PXGridColumn>
<px:PXGridColumn DataField="DateOut" Width="90" ></px:PXGridColumn>
<px:PXGridColumn DataField="DateDue" Width="90" ></px:PXGridColumn>
<px:PXGridColumn DataField="DateIn" Width="90" ></px:PXGridColumn>
</Columns>
</px:PXGridLevel>
</Levels>
<AutoSize Enabled="True" ></AutoSize>
</px:PXGrid>
<px:PXPanel runat="server" ID="CstPanelSSCS3" SkinID="Buttons">
<px:PXButton runat="server" ID="CstHistory" DialogResult="OK" Text="OK" CommandSourceID="ds" ></px:PXButton>
</px:PXPanel>
</px:PXSmartPanel>
如您在屏幕截图中所见,工具 #2 已被选中,但智能面板中的历史记录仍显示为工具 #1。然而,作为一项临时措施,我在主页上添加了一个辅助网格,它通过将以下内容添加到列出每个工具编号的主网格中来显示正确工具的历史记录。我在主页上的临时历史网格是 CstPXGrid38。在此处添加智能面板的控件 ID 不会像在主屏幕上更新历史网格那样更新智能面板的网格。
<AutoCallBack Command="Refresh" Target="CstPXGrid38" ActiveBehavior="true">
<Behavior RepaintControlsIDs="CstPXGrid38" ></Behavior>
</AutoCallBack>
实现所需功能的 PXSmarPanel 的通用声明应如下所示:
<px:PXSmartPanel ID="GridPanel" runat="server" Height="550px" Width="873px" Caption="My Fancy Grid refresh panel" CaptionVisible="True" Key="GridPanelView" AutoCallBack-Command="Refresh" AutoCallBack-Target="gridPanel" CreateOnDemand="True">
其中“gridPanel”是面板网格的 ID。