Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
Added state saving to the documentation.
  • Loading branch information
leemarkwood committed Oct 19, 2015
1 parent 3ecd259 commit ca3c772
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,8 @@ TabularTables.People = new Tabular.Table({
});
```



## Modifying the Selector

If your table requires the selector to be modified before it's published, you can modify it with the `changeSelector` method. This can be useful for modifying what will be returned in a search. It's called only on the server.
Expand All @@ -218,6 +220,22 @@ TabularTables.Posts = new Tabular.Table({
});
```

## Saving state

Should you require the current state of pagination, sorting, search, etc to be saved you can use the default functionality of Datatables.

Add stateSave as a property when defining the Datatable.
```js
TabularTables.Posts = new Tabular.Table({
// other properties...
stateSave: true
});
```

Add an ID parameter to the template include. This is used in localstorage by datatables to keep the state of your table. Without this state saving will not work.
```html
{{> tabular table=TabularTables.Posts id="poststableid" selector=selector class="table table-striped table-bordered table-condensed"}}
```

## Security

Expand Down

0 comments on commit ca3c772

Please sign in to comment.