Skip to content

scrollTo doesn't work with higher rowHeight #4776

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

Closed
projectX21 opened this issue Nov 27, 2015 · 10 comments
Closed

scrollTo doesn't work with higher rowHeight #4776

projectX21 opened this issue Nov 27, 2015 · 10 comments

Comments

@projectX21
Copy link

Hello everyone,

I've found a little Bug:
If you use a custom rowHeight, the scrollTo will not scroll exactly to the specified row.

I have a little example:
http://plnkr.co/edit/bO4JGSCeraASMTZ04zhA?p=preview

When you scroll down, and click the button "Go to top" afterwards, it will not scroll exactly to the first row.

Do you have a workaround for that problem? This is needed in my project.

Thank you for your help!

@yehuabin
Copy link

Can $http.get support cross domain?

@projectX21
Copy link
Author

Sorry but I don't get it. Is that related to my question?

@yehuabin
Copy link

sorry not related. that just my a question

@imbalind
Copy link
Contributor

@projectX21 the problem is here where you can see:

var pixelsToSeeRow = ((seekRowIndex + 1) * self.options.rowHeight);

here the +1 is needed to account for the header, but this is obviously right only if rowHeight === headerHeight. To make it more generic this should come:

var pixelsToSeeRow = ((seekRowIndex) * self.options.rowHeight + self.headerHeight);

@projectX21
Copy link
Author

Thank you very much for this hint!

But is there a possibilty to get this work without modifing the source code?

@imbalind
Copy link
Contributor

Meh.. I don't think so. Unless you can afford to have headers as high as the rows are.

@imbalind
Copy link
Contributor

Here's a modified version of the plunkr, I had to add a minified version of ui-grid.js because of size issues.

swalters added a commit that referenced this issue Dec 2, 2015
fix(core): Fix #4776 scrollTo doesn't work with higher rowHeight
@kylehoehns
Copy link

@JLLeitschuh any idea when the 3.0.8 release is scheduled? We are running into this same issue after upgrading from 3.0.1 to 3.0.7 and were hoping we could get this fix before our next release.

@projectX21
Copy link
Author

But ist there an option to define the height of the header? On the wiki page I don't find such a property.

sbruno pushed a commit to sbruno/ui-grid that referenced this issue Dec 24, 2015
…eight

Change the way pixelsToSeeRow variable is calculated. This way
is possible to have different heights for rows and column headers.
@lvostinar
Copy link
Contributor

This issue is still not fixed. See http://plnkr.co/edit/aIxHXHKTSlxeSDavfqtR?p=preview . When pressing Scroll to top it scrolls to row with id 498. Scrolling is not really correct, row is only partially visible (with header height). So, now, scrolling as first row works well but scrolling as last row is broken.

See also comments from #4204 , which is a duplicate issue.

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

No branches or pull requests

5 participants