0.1.8 • Published 8 years ago

react-list-combo v0.1.8

Weekly downloads
3
License
MIT
Repository
github
Last release
8 years ago

A group of isomorphic reactjs components for rendering lists.

Installation

npm install react-list-combo

Documentation

ListView:

<ListView initData={object|array} dataSource={function} perPage={number}></ListView>
  • initData: (required) The initial page of results or all results.
  • dataSource: (optional) Only required for server side pagination. Has a page parameter to specify the next page of results.
  • perPage: (optional) Only required for client side pagination.

ListRows:

<ListRows rowClassName={string}>{Component}</ListRows>
  • rowClassName: (optional) The css class to add to each row.
  • Component: (required) The component to render for each row. parameter passed are data and id.

GridView:

<GridView tableClassName={string} currentData={array} currentPage={number} perPage={number}></GridView>
  • tableClassName: (optional) The class to apply to the table.
  • currentData: (required) The data to show. If nested under ListView it will be provided automatically.
  • currentPage: (required) The currentPage to show. If nested under ListView it will be provided automatically.
  • perPage: (required) The current number of results to show. If nested under ListView it will be provided automatically.

GridColumn:

<GridColumn header="{string}" name="{string}">{Component}</GridColumn>
  • header: (optional) The column header.
  • name: (required) The object key for each row.
  • Component: (optional) Can be a custom component to help display the data.

Counter

<Counter wrapperClassName={string} currentPage={number} perPage={number} totalCount={number}>{Component}</Counter>
  • wrapperClassName: (optional) class to add to the wrapper div.
  • currentPage: (required) The current page. If directly under ListView will be provided automatically.
  • perPage: (required) The number to show per page. If directly under ListView will be provided automatically.
  • totalCount: (required) The total count of items. If directly under ListView will be provided automatically.
  • Component: (optional) Can be a custom component to change how to display the data.

Pagination:

<Pagination currentPage={number} pagesCount={number} pageSpan={number} changePage={function} />
  • currentPage: (required) The current page index. If directly nested under ListView will be provided automatically.
  • pagesCount: (required) The total number of pages. If directly nested under ListView will be provided automatically.
  • pageSpan: (optional - default: 2) The breadth of page numbers to display.
  • changePage: (required) function to execute when pagination is used. If directly nested under ListView will be provided automatically. Callback has page number as a parameter.

Examples

Bootstrap basic usage. see examples for more info.

<ListView initData={ users } dataSource={ this.fetchMore.bind(this) }>
  <GridView tableClassName="table table-bordered table-response table-hover table-condensed">
    <GridColumn header="#" name="id" />
    <GridColumn header="First Name" name="firstName" />
    <GridColumn header="Last Name" name="lastName" />
    <GridColumn header="Username" name="username" />
    <GridColumn header="Active" name="active" />
  </GridView>
  <Pagination />
</ListView>

Examples are provided in the examples folder. There is an example of both server and client style pagination that use the same endpoint. The example uses redux.

https://github.com/shockjs/react-list-combo/tree/master/dist/examples

The MIT License (MIT)

Copyright (c) 2015 Damian Dennis

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

0.1.8

8 years ago

0.1.7

8 years ago

0.1.6

8 years ago

0.1.5

8 years ago

0.1.4

8 years ago

0.1.3

8 years ago

0.1.2

8 years ago

0.1.1

8 years ago

0.1.0

8 years ago

0.0.17

8 years ago

0.0.16

8 years ago

0.0.15

8 years ago

0.0.14

8 years ago

0.0.13

8 years ago

0.0.12

8 years ago

0.0.11

8 years ago

0.0.10

8 years ago

0.0.9

8 years ago

0.0.8

8 years ago

0.0.7

8 years ago

0.0.6

8 years ago

0.0.5

8 years ago

0.0.4

8 years ago

0.0.3

8 years ago

0.0.2

8 years ago

0.0.1

8 years ago