VultureMF
VultureMF

Reputation: 49

Table scrolling is not working with treegrid

I have a treegrid I'm using in a NodeJS page to display the contents of a share drive directory. I have discovered that, when enough elements on the screen are expanded to where they don't all fit in the table, that PageUp and PageDown do not work for scrolling. Neither do up arrow and down arrow. The mouse wheel will scroll the table, but that is the only way to scroll. And since I'm trying to make the application handicapped-accessible, this is not sufficient.

Here is the EJS file I'm using.

<div>
  <h1 class="title mt-2" id="registration-title">View/Download Share Drive Files</h1>
  <div id="mytreegrid" style="display:flex; justify-content: center;" data-toggle="tooltip" data-position="left" title="Sessions/files available for download"></div>
  <br/>
  <form id="filesform" action="/files/download" method="post">
    <input style="display: none;" id="name" name="name" required />
    <input style="display: none;" id="type" name="type" />
    <input style="display: none;" id="path" name="path" />
    <div style="float: right; padding-right: 250px; width: 200px;" data-toggle="tooltip" data-position="top" title="Click to download files">
      <input type="submit" value="Download" class="btn btn-lg btn-width btn-primary test-decoration-none text-light shadow-btn" onclick="return validate()" />
    </div>
  </form>
</div>

<script>
  function drawTreeGrid() {
    var data = <%- !userJson.kontent ? '"empty"' : userJson.kontent.startsWith("{") ? '""' : userJson.kontent %>;
    
    if (data == "empty") {
      window.location.href = '/reroute'
      return
    }

    var options = {
      'width': '985px',
      'height': '400px'
    }

    var container = document.getElementById('mytreegrid');
    var treegrid  = new links.TreeGrid(container, options);
    var dataTable = new links.DataTable(data);

    links.events.addListener(treegrid, 'select', function(properties) {
      var holdit = getFirstItem(properties.items);

      if (holdit != '') {
        var name = document.getElementById("name");
        var type = document.getElementById("type");
        var path = document.getElementById("path");
        
        name.value = holdit.name;
        type.value = hold._type;
        path.value = hold._path;
      }
    });

    treegrid.draw(dataTable);
  }
</script>

Any assistance you can provide will be greatly appreciated.

Upvotes: 0

Views: 22

Answers (0)

Related Questions