Is there a lightweight way to display Tree-Grid-Data in Forms?

Hi community,

I am playing around with displaying some data structure as Tree-Grid-View in Forms. The amount of data is very small.

Normally we can display Tree-Grid-View data in relationships or pop-up dialogs. But I don´t want that users have to click around every time they need to see the data. It´s data that´s useful for daily work, so it would be super useful when it´s directly accessible within the Form.

I discovered that it is possible to display Tree-Grid-Views in Forms. But from my POV the regular TGV layout is a little bit too heavy for my use case. I only want to display a small amount of data (only one data column, not much levels). Basically I just need the TGV data, no toolbar, no headers, no actions. Just a simple view to the data.

Does anyone now a more lightweight rendering variants for TGVs?

Thanks for any input!

Angela

Parents Reply Children
  • 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.

  •  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!

    // eslint-disable-next-line
    // @ts-nocheck
    var topWindow = aras.getMostTopWindowWithAras(window);
    var tgvdIdParam;
    var startConditionProviderParam;
    var parametersProviderParam;
    
    tgvdIdParam = 'tgvdId=60354DB4DEA04643818D20290DC967DC';
    startConditionProviderParam = 'startConditionProvider=ItemDefault({"id":"id"})';
    
    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[i]) {
    		tgvUrl += (i === 0 ? '' : '&') + allParams[i];
    	}
    }
    
    var iframe = document.createElement('iframe');
    iframe.id = 'tree_grid_viewer';
    iframe.width = '50%';
    iframe.height = '50%';
    iframe.position = 'absolute';
    iframe.top = '190px';
    iframe.left = '167px';
    iframe.frameBorder = '0';
    iframe.scrolling = 'auto';
    iframe.src = tgvUrl;
    document.body.insertBefore(iframe, document.body.childNodes[0]);

  • "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....!Grinning

    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.