Forum Discussion
christopher_gillis
8 years agoNew Member
Hello,
There is an example of how a TGV can be inserted into an HTML document under \Innovator\Client\Modules\aras.innovator.TreeGridView\Examples\RelationshipTab.js .
This seems to be intended to be done to the RelationshipsGrid, but you could also take these steps and apply them to a Form item with an HTML field by using the steps below.
Christopher Gillis Aras Labs Software Engineer
- Create a new Form named "My Part-Document TGV"
- Add an html field to the Form
- Remove the label from the field
- Set the position of the field to (0, 0)
- Add the code below to the HTML code field and update the tgvID in the place marked
- `<script>var topWindow = aras.getMostTopWindowWithAras(window); var tgvdIdParam; var startConditionProviderParam; var parametersProviderParam; tgvdIdParam = 'tgvdId=9935955AA610437E86591DB44AF53B1B'; // <-- Change this ID to the ID of your TGV var tgvUrl = aras.getBaseURL('/Modules/aras.innovator.TreeGridView/Views/MainPage.html?'); var allParams = [tgvdIdParam, startConditionProviderParam, parametersProviderParam]; for (var i = 0; i < allParams.length; i++) { if (allParams) { tgvUrl += (i === 0 ? '' : '&') + allParams; } } var iframe = document.createElement('iframe'); iframe.id = 'tree_grid_viewer'; iframe.width = '100%'; iframe.height = '100%'; iframe.frameBorder = '0'; iframe.scrolling = 'auto'; iframe.src = tgvUrl; document.body.insertBefore(iframe, document.body.childNodes[0]); </script>`
- Confirm that your TGV appears as expected in the Form Preview
- Create a new dummy ItemType to represent this TGV in the TOC
- Navigate to the TOC View tab of this ItemType
- Create a new TOC View
- Set the Identity to World or whoever should be able to see this TGV
- Set the Form [...] property to the form we created in step 2
- Save the ItemType
- Navigate to this ItemType in the TOC and confirm that your TGV appears as expected
Christopher Gillis Aras Labs Software Engineer