Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add row options #74

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,8 @@ Define the settings in a helper for the template that calls reactiveTable:
* `showNavigation`: 'always', 'never' or 'auto'. The latter shows the navigation footer only if the collection has more rows than `rowsPerPage`.
* `fields`: Object. Controls the columns; see below.
* `useFontAwesome`: Boolean. Whether to use [Font Awesome](http://fortawesome.github.io/Font-Awesome/) for icons. Requires the `font-awesome` package to be installed. Default `false`.

* `rowId`: Boolean. If `true` the row gets an `id` tag that contains the document `_id` from the collection
* `rowClass`: Text. Add classes to every table row, e.g. `'link'`

### Styling

Expand Down
2 changes: 1 addition & 1 deletion lib/reactive_table.html
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
</thead>
<tbody>
{{#each sortedRows}}
<tr>
<tr id="{{#if ../rowId}}{{this._id}}{{/if}}" class="{{../rowClass}}">
{{#each ../fields}}
<td class="{{key}}">{{#if tmpl}}{{#with ..}}{{> ../tmpl}}{{/with}}{{else}}{{getField ..}}{{/if}}</td>
{{/each}}
Expand Down
4 changes: 3 additions & 1 deletion lib/reactive_table.js
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,9 @@ var generateSettings = function () {
settings: settings,
fields: fields,
useFontAwesome: settings.useFontAwesome,
showFilter: showFilter
showFilter: showFilter,
rowId: settings.rowId,
rowClass: settings.rowClass
};
};

Expand Down