Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using columnOrder API issue #156

Closed
LabShareLouie opened this issue Aug 10, 2018 · 2 comments
Closed

Using columnOrder API issue #156

LabShareLouie opened this issue Aug 10, 2018 · 2 comments

Comments

@LabShareLouie
Copy link

Expected behavior and actual behavior.

Hi @TonyGermaneri,

I'm still not able to use grid.columnOrder to change the columnOrder either on initialization or on event listening using v0.21.2.

The getter seems to work, however the setter does not. Using the setter grid.columnOrder = [2, 1, 0];, I get the following console error Uncaught ReferenceError: s is not defined.

Below is my test.html code to reproduce the problem.

Steps to reproduce the problem.

<!DOCTYPE html>
<html>
<head>
  <script type="text/javascript" src="./canvas-datagrid.js"></script>
  <style type="text/css">
    #grid { height: 300px; } #grid canvas, #grid canvas-datagrid { --cdg-height: 300px; }
  </style>

  <script type="text/javascript">
  window.addEventListener('load', function () {
      var parentNode = document.getElementById('grid');
      var grid = document.createElement('canvas-datagrid');
      parentNode.appendChild(grid);
      grid.data = [
          {col1: 'foo', col2: 0, col3: 'a'},
          {col1: 'bar', col2: 1, col3: 'b'},
          {col1: 'baz', col2: 2, col3: 'c'}
      ];
      grid.columnOrder = [2, 1, 0];
      grid.addEventListener('reorder', function () {
        grid.columnOrder = [1, 2, 0];
    });
  });
</script>

</head>
<body>
  <div id="grid"></div>
</body>
</html>

Specifications like the version of the project, operating system, or hardware.

MAC OSX 10.12.6
Google Chrome 67.0.3396.99

@LabShareLouie LabShareLouie changed the title Using columnOrder API Using columnOrder API issue Aug 10, 2018
TonyGermaneri added a commit that referenced this issue Aug 10, 2018
@TonyGermaneri
Copy link
Owner

Wow, I feel like a big jerk. s really isn't defined. I'll get it fixed right now. v0.21.3 will have the fix, I'll publish it in a moment.

@LabShareLouie
Copy link
Author

Looks like the API is working with the fix. Thanks @TonyGermaneri!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants