1.0.26 • Published 7 years ago

react-virtualgrid v1.0.26

Weekly downloads
4
License
MIT
Repository
github
Last release
7 years ago

Infinite scrolling grid which uses promises to asynchronously load the grid. Loads only what is necessary to keep memory usage low.

For live demo look at https://kavithalk.github.io/

Installation

npm install
npm start
open http://localhost:3000

###Example

 import React, { Component } from 'react';
 import VirtualGrid from './component/VirtualGrid';

 export default class AppVirtualGrid extends React.Component {

constructor(props) { super(props); }

   render() {
		return (
        	<VirtualGrid  getPromise={this.getPromise.bind(this)} width="1000" height="800" itemHeight={200} itemWidth={200}></VirtualGrid>
		);

}

getPromise(index){ if (index < 0) { return Promise.resolve(null); } return new Promise(function(resolve, reject) { setTimeout(function(){ resolve(<div style={{height: 190 + 'px', backgroundColor: '#7DCEA0', width:190 + 'px' , display:'table-cell', verticalAlign:'middle'}}><h2 style={{color: '#555', textAlign : 'center' }}>{index}); }, Math.random()*(10000)+1000); }); } }

Credits

Component uses a scrollbar that is derived from BosNaufal/react-scrollbar to support virtual scrolling.

License

MIT Copyright (c) 2016

1.0.26

7 years ago

1.0.25

7 years ago

1.0.24

7 years ago

1.0.23

7 years ago

1.0.22

7 years ago

1.0.21

7 years ago

1.0.19

7 years ago

1.0.18

7 years ago

1.0.17

7 years ago

1.0.16

7 years ago

1.0.15

7 years ago

1.0.14

7 years ago

1.0.13

7 years ago

1.0.12

7 years ago

1.0.11

7 years ago

1.0.10

7 years ago

1.0.9

7 years ago

1.0.8

7 years ago

1.0.6

7 years ago

1.0.5

7 years ago

1.0.4

7 years ago

1.0.3

8 years ago

1.0.2

8 years ago

1.0.1

8 years ago

1.0.0

8 years ago