Forum Discussion
Tree are my nemesis in 2022.
TGV in Forms is not super hard to do. You use a html element that carries an empty iframe. Then use the standard Method produced by TGV but connect the TGV to the iframe instead of populating a pop-up dialog. I remember there is even some sample on Github (was a question by another user somewhere).
But no: I so far didn´t succeed to make it lightweight without the toolbar and stuff.
In general I am constantly looking for easy to use solutions to build custom trees.
The shown approach by alaxala would be perfect, if AML would return us the levels. Which lead to this unsolved question:
https://community.aras.com/f/development/37188/how-to-get-level-depth-of-items-returned-from-an-getitemrepeatconfig-aml-query
Other tree design are supported by Aras, but they all require much investigations:
https://community.aras.com/f/development/36981/tgvgrids-vs-treegridviews---what-is-the-difference-and-which-one-is-intended-to-be-used
It would be cool if we could add more custom elements in the tgv...
https://community.aras.com/f/development/5565/tree-grid-view-tgv-how-i-can-render-a-cell-as-an-icon-image
The tree I work on right now required a lot of custom elements like images, input fields, button, links, etc. . In this case I ended up using an external jquery library for rendering the tree. In my case the data was federated from another database via SQL. So in this case was able to do the level calculation with SQL. But I would be happy to know an easy way to do it without SQL. Aras TGVs calculate levels, but the used code is very inflexible in the moment.
So I hope you now have get some inspiration about trees in the Forms. I anyone knows even more variants please let me know [emoticon:6d505171faa4497c85c5ca27290c555d]
- AngelaIp4 years agoIdeator I
Hi Alaxala,
I had seen your attempts to post something. I even had seen your samples. But of course I closed the window in between.
I assume your post was classified as spam. The forum use very strict filters since the spam war last year ago. Unfortunately Aras doesn´t seem to actively monitor this forum anymore, so I don´t think anyone of them will help. The last time I tried to write to the Aras Labs team I was more or less ghosted.
I know that you have posted some AML query and an XSL transformation and something else that I don´t remember.
The main question for me is right now, how to make the XSL transformation inside of a Javascript function?
There is one Innovator Method for XSLT transformation, e.g.
aras.applyXsltString(res, xsl_stylesheet);
Problem: This one relies on a "Report" Item to carry the stylesheet. I don´t want to use a Report item. We maybe can store the XSL file inside of the codetree, e.g. as seen here: https://www.w3schools.com/xml/xsl_client.asp . But I don´t have much experience with XSL transformations.
- jeff_stroh4 years agoIdeator I
AngelaIp thanks for the pointer! After some digging I found this thread: tree-view-in-main-grid
That got me in the right direction, but running into an issue of the method is blankly dumping the TGV into the form, not into the HTML container designated. I assume I'm missing something to grab the ID of the container or need to change out the document.createElement...? I've named the HTML container on the form as "tree_grid_viewer", but doesn't seem to work. The method is set to run onFormPopulated against the Form Body.
Any help would be appreciated!
[embed:dc8ab71f-3b98-42d9-b0f6-e21e02a0f8e2:e1c9db47-f071-429f-99e2-ee20408a279e:type=javascript&text=%2F%2F%20eslint-disable-next-line%0D%0A%2F%2F%20%40ts-nocheck%0D%0Avar%20topWindow%20%3D%20aras.getMostTopWindowWithAras%28window%29%3B%0D%0Avar%20tgvdIdParam%3B%0D%0Avar%20startConditionProviderParam%3B%0D%0Avar%20parametersProviderParam%3B%0D%0A%0D%0AtgvdIdParam%20%3D%20%27tgvdId%3D60354DB4DEA04643818D20290DC967DC%27%3B%0D%0AstartConditionProviderParam%20%3D%20%27startConditionProvider%3DItemDefault%28%7B%22id%22%3A%22id%22%7D%29%27%3B%0D%0A%0D%0Avar%20tgvUrl%20%3D%20aras.getBaseURL%28%0D%0A%09%27%2FModules%2Faras.innovator.TreeGridView%2FViews%2FMainPage.html%3F%27%0D%0A%29%3B%0D%0Avar%20allParams%20%3D%20%5B%0D%0A%09tgvdIdParam%2C%0D%0A%09startConditionProviderParam%2C%0D%0A%09parametersProviderParam%0D%0A%5D%3B%0D%0Afor%20%28var%20i%20%3D%200%3B%20i%20%3C%20allParams.length%3B%20i%2B%2B%29%20%7B%0D%0A%09if%20%28allParams%5Bi%5D%29%20%7B%0D%0A%09%09tgvUrl%20%2B%3D%20%28i%20%3D%3D%3D%200%20%3F%20%27%27%20%3A%20%27%26%27%29%20%2B%20allParams%5Bi%5D%3B%0D%0A%09%7D%0D%0A%7D%0D%0A%0D%0Avar%20iframe%20%3D%20document.createElement%28%27iframe%27%29%3B%0D%0Aiframe.id%20%3D%20%27tree_grid_viewer%27%3B%0D%0Aiframe.width%20%3D%20%2750%25%27%3B%0D%0Aiframe.height%20%3D%20%2750%25%27%3B%0D%0Aiframe.position%20%3D%20%27absolute%27%3B%0D%0Aiframe.top%20%3D%20%27190px%27%3B%0D%0Aiframe.left%20%3D%20%27167px%27%3B%0D%0Aiframe.frameBorder%20%3D%20%270%27%3B%0D%0Aiframe.scrolling%20%3D%20%27auto%27%3B%0D%0Aiframe.src%20%3D%20tgvUrl%3B%0D%0Adocument.body.insertBefore%28iframe%2C%20document.body.childNodes%5B0%5D%29%3B]
- AngelaIp4 years agoIdeator I
"the method is blankly dumping the TGV into the form, not into the HTML container designated."
Yeeees...cause this is what your code does right now. It creates a NEW iframe and dumps the TGV straight into the form with document.body.insertBefore.
Why not do something like this:
var iframe = document.getElementById("bplTgvFrame");
...
iframe.src = tgvUrl;I should start to write consulting invoices....![emoticon:44a8a53ad3364ea78a16c5a3229f75bb]
Unfortunately we lost user Alaxala in this threat due to the spam filter. Alaxala showed me another useful approach, but weren´t able to test it yet.