GithubHelp home page GithubHelp logo

skeithyip / data-grid Goto Github PK

View Code? Open in Web Editor NEW
1.0 2.0 0.0 4.03 MB

Data Grid using React Virtualized Grid + InfiniteLoader + Redux

HTML 2.11% CSS 4.19% JavaScript 93.66% Shell 0.04%
reactjs infinite-scroll redux virtual-scroll pivot data-grid

data-grid's Introduction

Data Grid

This is a Data Grid built using

Create React App

react-virtualized

Redux


alt text

Features


Virtual Scroll

Infinite Scroll for lazy data fetching

Data grouping

How grouping works with infinite scrolling


Basically 2 queries will need to be fired off to the database.

The first being group and its count

select memberType, count(1) from members group by memberType;
Member Type Count
MemberTypeA 10
MemberTypeB 20
MemberTypeC 100

This should form the basis of the group rows to be displayed.

The second query would be similar but instead of having group in the query, the group will be part of the order by clause. Plus the data index that needs to be loaded.

select memberType, name from members order by memberType limit 10 offset 20;

The selector creates the row indices plus matching row to data index for the query.

Note


This project is not meant to be used as dependency. This is just a demonstration of combining React Virtualized's Infinite Scroll with data grouping.

Please feel free to look at (or even copy) the source code. Unit tests have also been provided to help understand the flow.

Limitations


There is a current problem with react-virtualized whereby visible range will not cause loadMoreRow to fire off even though rowCount is different. A weird fix is in placed to overcome this problem but doesn't seem to be perfect as I am still not too sure where is the correct placement of resetCache.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.