In Acumatica I would like to create a TreeView for a Bill of Material Screen. This is what the screen currently looks like and I need help populating the tree seen to the left of the grids. I would like the top value of the tree to be the BOM Item and then the materials that make up that item would open below that for each item. Here is my code so far.
<DataTrees>
<px:PXTreeDataMember TreeKeys="BOMID" TreeView="Nodes" />
<px:PXTreeDataMember TreeView="_AMBOMTree_Tree_" TreeKeys="OberNbr" />
<px:PXTreeDataMember TreeKeys="Key" TreeView="CacheTree" />
<px:PXTreeDataMember TreeKeys="Key" TreeView="EntityItems" />
</DataTrees>
This is for the Data Tree itself.
<px:PXTreeSelector CommitChanges="True" SuppressLabel="False" ID="edGraphType" runat="server" DataField="GraphType" PopulateOnDemand="True"
ShowRootNode="False" TreeDataSourceID="ds" TreeDataMember="CacheTree" InitialExpandLevel="0" MinDropWidth="297" MaxDropWidth="500"
TextField="Name" Size="XL">
<Images>
<ParentImages Normal="tree@Folder" Selected="tree@FolderS" />
<LeafImages Normal="tree@Screen" Selected="tree@Screen" />
</Images>
<DataBindings>
<px:PXTreeItemBinding DataMember="CacheTree" TextField="Name" ValueField="SubKey" ImageUrlField="Icon" />
</DataBindings>
</px:PXTreeSelector>
Here is the TreeSelector. Now I pulled this from a different screen and wondering exactly how this all works. Since I want the Item to show up at the top level then go to the Materials that make up that item. I want the grids to populate if an item is selected. I know the DataField = GraphType is not correct as this was pulled from a different screen, but I do not know the value that is supposed to be here.
<px:PXTreeView ID="tree" runat="server" DataSourceID="ds" Height="500px" PopulateOnDemand="True" ShowRootNode="False"
ExpandDepth="1" AutoRepaint="true" Caption="Tree" AllowCollapse="true" PreserveExpanded="true">
<ToolBarItems>
<px:PXToolBarButton Tooltip="Reload Tree" ImageKey="Refresh">
<AutoCallBack Target="tree" Command="Refresh" />
</px:PXToolBarButton>
</ToolBarItems>
<AutoCallBack Target="grid" Command="Refresh" ActiveBehavior="True">
<Behavior RepaintControlsIDs="gridMatl" />
<Behavior RepaintControlsIDs="gridStep" />
<Behavior RepaintControlsIDs="gridTool" />
<Behavior RepaintControlsIDs="gridOvhd" />
</AutoCallBack>
<AutoSize Enabled="True" MinHeight="300" />
<DataBindings>
<px:PXTreeItemBinding DataMember="Nodes" TextField="Name" ValueField="AssignmentRouteID" ImageUrlField="Icon" />
</DataBindings>
</px:PXTreeView>
Then this is the Tree View itself.
If someone can help me code up this tree that would be great or at least point me in the right direction.