0

I have a set of about 4000 records. I display 15 at a time in a table and I am curious if there is anyway to implement a "scroll animation" that would allow users to scroll to a specific position in the table?

For example if the user was viewing records 1-15 and they wanted to view the 2000-2015 records is there a plugin that would make the records appear to scroll down to that position.

Also, would doing this cause performance problems (since I would potentially be loading 4000 records)?

Abe Miessler
  • 82,532
  • 99
  • 305
  • 486

2 Answers2

2

Yes there is. You could think of also generating an anchor <a> per row, so you could just scroll to a specific place.

Here is a plugin that does that for you: http://plugins.jquery.com/project/ScrollTo

Marnix
  • 6,384
  • 4
  • 43
  • 78
  • +1 I have used scrollto in quite a few projects and it's rock solid! – Blindy Jun 24 '11 at 16:44
  • It's rather unnecessary to generate an extra element per row, and with a large number of DOM elements, you really want to minimize overheard. Just add a unique ID to each row, like ` – Matt Ball Jun 24 '11 at 16:56
  • I don't know what's possible with ScrollTo, so yeah if you can just scroll to a `tr`, that's fine with me too. But I was thinking of anchors, because that is normally a logical place to scroll to. – Marnix Jun 24 '11 at 16:58
1

You've got two separate questions here.

First check out a grid plugin that can handle huge data sets. This is usually done with virtual rendering.
I like SlickGrid (among many other places, it's used to display query results in SEDE).

Then you can figure out how to scroll to a particular row, since this will almost certainly depend on the grid implementation itself.

Community
  • 1
  • 1
Matt Ball
  • 354,903
  • 100
  • 647
  • 710
  • SlickGrid looks promising, but I am having trouble finding resources for it. Take a look at this related question if you have a moment: http://stackoverflow.com/questions/6473621/good-tutorial-for-slickgrid – Abe Miessler Jun 24 '11 at 21:13