Tree view in main grid

Hi there, I'm currently fumbling around with SP12 and am trying to get a tree grid view to display on the main grid instead of a relationship grid. For instance, I'd want to display all my Part BOMs in the main grid to allow users to manually browse through them. A next step would be to show both Part BOMs and Part Documents so users can navigate through the Part structure to find the Document item they want to work on/review etc. I manage to get the grid up and running in relationship grids using the Tree Grid View and Query builder but can't seem to get it to work in the main grid. To make things easier, our Part items have an "is_top" property to define whether or not the item is the top item in its respective Part BOM, so to gather the top elements for each Part BOM one just has to look for elements where the "is_top" property is set to 1. From there, the rest of each tree can be added.
Parents
  • Hello, If you're getting the TGV to display in a dialog, all you should need to do is replace the call to create a dialog with a call to insert an 'iframe' into the document like the example below.
    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];
    }
    }
    /* This call to a dialog is replaced with the code below
    var dialogParameters = {
    dialogWidth: 800,
    dialogHeight: 600,
    title: 'Tree Grid View Sample',
    content: tgvUrl
    };
    topWindow.ArasModules.MaximazableDialog.show('iframe', dialogParameters).promise.then(function() {
    delete topWindow.CustomStartConditionProvider;
    delete topWindow.CustomParametersProvider;
    });
    */
    // Use this code instead to insert an iframe directly into the HTML instead of opening it through a dialog
    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]);
    In regards to the other issue you're seeing with trees being displayed many times, this may be an issue with your query itself or the starting parameters that you're passing in. I'd suggest reviewing the query in the Query Definition editor and use the "Execute Query" action to test that the arguments you're passing in are giving the results you expect. Chris
    Christopher Gillis Aras Labs Software Engineer
Reply
  • Hello, If you're getting the TGV to display in a dialog, all you should need to do is replace the call to create a dialog with a call to insert an 'iframe' into the document like the example below.
    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];
    }
    }
    /* This call to a dialog is replaced with the code below
    var dialogParameters = {
    dialogWidth: 800,
    dialogHeight: 600,
    title: 'Tree Grid View Sample',
    content: tgvUrl
    };
    topWindow.ArasModules.MaximazableDialog.show('iframe', dialogParameters).promise.then(function() {
    delete topWindow.CustomStartConditionProvider;
    delete topWindow.CustomParametersProvider;
    });
    */
    // Use this code instead to insert an iframe directly into the HTML instead of opening it through a dialog
    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]);
    In regards to the other issue you're seeing with trees being displayed many times, this may be an issue with your query itself or the starting parameters that you're passing in. I'd suggest reviewing the query in the Query Definition editor and use the "Execute Query" action to test that the arguments you're passing in are giving the results you expect. Chris
    Christopher Gillis Aras Labs Software Engineer
Children
No Data