Show HN: A ReactJS Grid Component with infinite scroll, customization, and more
dynamictyped.github.io
dynamictyped.github.io
I searched for "dog"
and it yielded these two rows:
Perkins Leblanc Boyd Utah Brunei
Alyce Chavez Bendon Iowa Portugal
I am pretty sure "dog" isn't in either of those rows? What am I missing?
https://github.com/DynamicTyped/Griddle/blob/master/scripts/...
In our case, we needed to filter on hidden columns (as we still cared about the data behind the scenes), but I'm thinking that this is something that should be optional.
1. Change settings to 100 rows per page,
2. scroll down to see "Next" button
3. press it twice (until it disappears)
4. Page is scrolled down - unexpected behavior.Like if you need to inline images which might be variable sizes.
I think it's probably possible, with some clever caching of row heights and recalculation of some sort, in order to maintain a correctly sized spacer element at the top/bottom. Not seen any examples of it.
I haven't tried it yet, so I may be wrong.
It's definitely something Ryan and I (or anyone else that might want to contribute) will be revisiting in the near future, potentially as a config option.
My use case: I have columns A and B and instead of displaying both I want column A with data from B in it. So I thought I'd set B to "visible: false" and then use rowData.b in the custom component of A.
That doesn't work ;-(
IMO, the fact that React components can be easily shared with an interface that follows a common pattern is a major strength of React, rather than a weakness.
With Griddle, we were trying to mostly stick with React so it could be used without other libraries (we do currently have a dependency on underscore but we're hoping to remove that at some point in the future as well).
I rewrote it in React and got the render time down to around 600ms~ Not GREAT, but far more acceptable than a couple seconds. It's worth noting that the react version doesn't do anything fancy, it just has to display the table with some tooltips. (There's a lot of room for improvement, for example, I could only render whatever amount of rows are in view and defer rendering the rest.)
I tried Griddle and, if I'm remembering properly, it took around five seconds to render a 750x40 table. The overhead of all the features they provide made it a suboptimal solution for us :(.
Unfortunately, I don't think you can optimize horizontal scrolling as easily as you can optimize vertical scrolling. I looked around as well and was unable to find a suitable library.
Horizontal scrolling definitely sounds like an interesting idea. Seems like it would be feasible to add -- I'll have to think about that a bit more. Also, if the solution you came up with is online anywhere I'd love to see it!
More common is that I just don't know how many columns there will be (or the datatype, optimal width, etc) until the user performs a series of actions and renders a particular view. I've shoehorned a solution into extjs that works (not scrolling, just dynamically defined), but I'm always looking for options.
I don't think a user would be able to meaningfully navigate a table like that by scrolling it. How would they cognitively track where they are or how to return to interesting parts of the data? IMHO, you should rethink how to display and navigate this data. The user would need sophisticated search/filtering support.
A side window let's you navigate at a high level (low res) and zoom in to data-dense areas. Low level / high res navigation in the grid might be used for exploring data from individual sensors, in context with interpolated values.
You can keep the scrollbars from becoming irrelevant by scaling to the size of a logical grid 'neighborhood' of adjacent tiles at the current zoom level.
[Knockout-Virtual-Grid](https://github.com/jstclair/knockout-virtual-grid)
[Live Demo](http://jsbin.com/roheqo/1/)
You can edit that on JsBin and easily increase the columns to 5-10,000. You may want to look at [editableCell](https://github.com/gnab/editableCell) for some of the keyboard shortcuts.
http://ui-grid.info/docs/#/tutorial/191_horizontal_scrolling
Also, hell, if you want to make a good demo project then re-writing something is a great place to start. A demo project that got me hired was just a designer and I's answer to Adobe Kuler.