Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/schne324/sortable-grid
Accessible sortable grid
https://github.com/schne324/sortable-grid
Last synced: about 2 months ago
JSON representation
Accessible sortable grid
- Host: GitHub
- URL: https://github.com/schne324/sortable-grid
- Owner: schne324
- Created: 2014-12-16T15:08:21.000Z (about 10 years ago)
- Default Branch: master
- Last Pushed: 2016-03-09T14:15:36.000Z (almost 9 years ago)
- Last Synced: 2024-04-24T10:24:50.059Z (9 months ago)
- Language: JavaScript
- Size: 77.1 KB
- Stars: 3
- Watchers: 4
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Sortable Grid
## How To Use
### Prepare your HTML
Add `class="sortable"` to each column header `` that should you wish to make sortable.
```html
My Table
Column One
Column Two
Column Three
column one data
column two data
column three data
```
### Invoke Sortable-Grid on your table
#### Option 1: *With* jQuery
In your HTML, include the jQuery plugin script:
```html
```
In your JavaScript, invoke `$.fn.sortableGrid()`:
```js
$('#my-table').sortableGrid();
```#### Option 2: *Without* jQuery
In your HTML, include the script:
```html
```
In your JavaScript, instantiate a new `SortableGrid#`:
```js
var table = document.querySelector('#my-table');
new SortableGrid(table);
```## Viewing the Demo
Requires [nodejs](http://nodejs.org)
```bash
$ git clone https://github.com/schne324/sortable-grid.git
```Then open `demo/index.html` in your browser.
## Rebuilding the Plugin
Requires [nodejs](http://nodejs.org)
If you wish to modify the plugin, make your changes to `src/index.js`. If you wish to modify the demo, make your changes to `demo/index.jade`.
In either case, when you are finished, rebuild by running:
```bash
$ npm run build
```