josebalius / ngReactGrid

A really fast Angular grid using the power of React to render. Based on ng-grid and jQuery DataTables.
http://josebalius.github.io/ngReactGrid/
MIT License
328 stars 47 forks source link

More than one grid on page problem with horizontal scrolling #42

Closed kashcode closed 9 years ago

kashcode commented 9 years ago

Please check this plunk http://plnkr.co/edit/7CNEwo?p=preview in this example I create two grids on first grid scrolling works fine, but on second grid horizontal scrolling scrolls data without headings, I need fix :)

kashcode commented 9 years ago

Code that fixed that problem:

componentDidMount: function () {
   var domNode = this.getDOMNode();
   var domContainer = domNode.parentNode;
   var header = domContainer.querySelector(".ngReactGridHeaderInner");
   var viewPort = domContainer.querySelector(".ngReactGridViewPort");

   domNode.firstChild.addEventListener('scroll', function (e) {
      header.scrollLeft = viewPort.scrollLeft;
   });

   this.performFullRender();
},
josebalius commented 9 years ago

@turbosasa awesome! Would you mind submitting a PR?

josebalius commented 9 years ago

This can be closed thanks to @turbosasa PR #43