1
0
Fork 0
mirror of https://github.com/koalyptus/TableFilter.git synced 2024-05-16 05:17:19 +02:00
TableFilter/README.md

149 lines
4.6 KiB
Markdown
Raw Normal View History

2016-07-23 11:24:21 +02:00
[![Build Status](https://api.travis-ci.org/koalyptus/TableFilter.svg?branch=master)](https://travis-ci.org/koalyptus/TableFilter)
[![Document](http://koalyptus.github.io/TableFilter/docs/badge.svg)](https://koalyptus.github.io/TableFilter/docs/source)
# TableFilter
2014-07-20 13:32:13 +02:00
2015-07-10 01:21:11 +02:00
> A Javascript library making HTML tables filterable
2015-02-14 09:59:12 +01:00
2015-07-07 09:52:42 +02:00
TableFilter is a modernised version of the [HTML Table Filter generator](http://tablefilter.free.fr) javascript plugin.
This library adds to any html table a "filter by column" feature that enables
2015-06-09 10:46:08 +02:00
users to filter and limit the data displayed within a long table. By default, the script automatically adds a filter grid bar at the top of the desired table.
2015-06-08 13:49:14 +02:00
2015-07-19 13:30:16 +02:00
## Features
2015-06-06 16:16:41 +02:00
* Convert a regular HTML table into an advanced grid component providing:
* Advanced columns filtering model
* Sorting and pagination facilities
* Complete selection model ([ezEditTable](http://codecanyon.net/item/ezedittable-enhance-html-tables/2425123?ref=koalyptus) extension)
* Extended keyboard navigation ([ezEditTable](http://codecanyon.net/item/ezedittable-enhance-html-tables/2425123?ref=koalyptus) extension)
* Inline cell or row editing ([ezEditTable](http://codecanyon.net/item/ezedittable-enhance-html-tables/2425123?ref=koalyptus) extension)
* Row insertion or deleting ([ezEditTable](http://codecanyon.net/item/ezedittable-enhance-html-tables/2425123?ref=koalyptus) extension)
2016-04-12 09:49:54 +02:00
* And even more features...
2015-06-06 16:16:41 +02:00
* Attach to an existing HTML table
* Integration with any server-side technology as this is a pure client-side
solution
2016-04-12 09:49:54 +02:00
* Exhaustive documentation and poweful API
2015-06-06 16:16:41 +02:00
2015-07-19 13:30:16 +02:00
## Getting started
2015-10-15 13:24:22 +02:00
* Clone the repo using Git:
2015-07-10 01:21:11 +02:00
```shell
git clone --bare https://github.com/koalyptus/TableFilter.git
```
2015-10-15 13:24:22 +02:00
* You can [download](https://github.com/koalyptus/TableFilter/archive/master.zip) this repository.
* Alternatively, install TableFilter files in your npm enabled project using:
```shell
2015-12-30 07:59:20 +01:00
npm install tablefilter --save
2015-10-15 13:24:22 +02:00
```
* or get the future features from the ``next`` release channel:
```shell
2015-12-30 07:59:20 +01:00
npm install tablefilter@next --save
```
2016-05-20 08:41:20 +02:00
* If you don't use `npm`, you can also
[access these files on npmcdn](https://npmcdn.com/tablefilter/), download them
or point your package manager to them.
2015-07-10 01:21:11 +02:00
2015-07-19 13:30:16 +02:00
## Setup
2015-07-07 15:08:08 +02:00
Copy the ``tablefilter`` directory under ``dist`` and place it at desired location in your project. Then include the main js file in your page:
2015-06-08 13:49:14 +02:00
```shell
2015-06-08 13:55:57 +02:00
<script src="path/to/my/scripts/tablefilter/tablefilter.js"></script>
2015-06-08 13:49:14 +02:00
```
2015-06-08 13:55:57 +02:00
Place the following snippet just under the HTML table and always define a ``base_path`` property in the configuration object to reflect the path to the script
2015-06-06 17:18:53 +02:00
```shell
2015-06-08 13:49:14 +02:00
<script>
var tf = new TableFilter(document.querySelector('.my-table'), {
2015-06-08 13:55:57 +02:00
base_path: 'path/to/my/scripts/tablefilter/'
});
2015-06-08 13:49:14 +02:00
tf.init();
</script>
2015-06-06 17:18:53 +02:00
```
2015-07-01 09:39:29 +02:00
If the ``base_path`` property is not specified, it will default to ``/tablefilter`` directory:
```shell
your-page.html
2015-07-19 13:30:16 +02:00
|— tablefilter
2015-07-01 09:39:29 +02:00
```
2015-06-06 17:18:53 +02:00
2015-07-19 13:30:16 +02:00
## Development
This project requires node.js and Grunt to be installed:
2015-07-19 13:33:21 +02:00
- install [node.js](https://nodejs.org/)
2015-07-20 09:21:04 +02:00
- install [Grunt](http://gruntjs.com/getting-started) from the command line using npm (comes with node.js):
2015-07-19 13:30:16 +02:00
```shell
npm install -g grunt-cli
```
Once ``Grunt`` is sorted out you can follow the instructions below.
2015-06-06 16:16:41 +02:00
Start by installing any dependencies.
```shell
npm install
```
2015-06-06 16:36:49 +02:00
Use the Grunt ``dev`` task to launch a build / watch cycle and start the local
sever on port ``8080``:
```shell
grunt dev
```
2015-06-06 16:41:58 +02:00
Use the ``build`` task to generate a production build:
2015-06-06 16:36:49 +02:00
```shell
grunt build
```
2015-07-19 13:30:16 +02:00
The ``default`` Grunt task will create a production build, run the tests and finally generate the demos:
2015-06-06 16:36:49 +02:00
```shell
grunt
```
To run all the tests:
```shell
grunt test
```
2015-06-06 16:41:58 +02:00
and to run specific test(s):
2015-06-06 16:36:49 +02:00
```shell
grunt test-only:test.html
2015-06-06 16:41:58 +02:00
grunt test-only:test.html,test-sort.html
2015-06-06 16:36:49 +02:00
```
2015-06-06 16:16:41 +02:00
2015-07-07 14:45:49 +02:00
## Demos
Check out the online [examples](http://koalyptus.github.io/TableFilter/examples) or generate the demos locally:
```shell
grunt build-demos
```
then run the local webserver:
2015-07-07 14:45:49 +02:00
```shell
grunt server
```
then pick a demo from:
```shell
2015-07-07 15:22:37 +02:00
http://localhost:8080/demos/
2015-07-07 14:45:49 +02:00
```
2015-06-11 09:44:16 +02:00
## Documentation
Find exhaustive documentation on the configuration options in the [WIKI](https://github.com/koalyptus/TableFilter/wiki) section.
Autogenerated documentation of the ES6 modules is available on the website: [docs](http://koalyptus.github.io/TableFilter/docs)
2016-04-30 04:58:15 +02:00
If you previously used the HTML Table Filter Generator plugin, verify the configuration
2016-05-12 13:37:41 +02:00
options you are using are still supported: [Obsolete](https://github.com/koalyptus/TableFilter/wiki/Obsolete)
2016-04-30 04:58:15 +02:00
Run this task to generate the documentation in the ``docs/docs`` directory:
2015-08-06 08:24:34 +02:00
```shell
grunt esdoc
```
2015-06-06 17:02:31 +02:00
## Support
* GitHub for reporting bugs and feature requests.
2015-06-06 16:16:41 +02:00
2015-06-06 17:02:31 +02:00
## License
[MIT](LICENSE)
2015-06-13 11:03:33 +02:00
2015-06-26 10:11:16 +02:00
2015-06-13 11:03:33 +02:00
2015-07-06 10:08:37 +02:00