Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

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

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
```