Browse Source

{{#sortable}}, not {{sortable}} in README

pull/214/merge
Dan Dascalescu 10 years ago
parent
commit
ae8f76f19d
  1. 13
      meteor/README.md

13
meteor/README.md

@ -20,13 +20,13 @@ development framework. Read more at [Why Meteor](http://www.meteorpedia.com/read
Simplest invocation - order will be lost when the page is refreshed: Simplest invocation - order will be lost when the page is refreshed:
```handlebars ```handlebars
{{sortable <collection|cursor|array>}} {{#sortable <collection|cursor|array>}}
``` ```
Persist the sort order in the 'order' field of each document in the collection: Persist the sort order in the 'order' field of each document in the collection:
```handlebars ```handlebars
{{sortable items=<collection|cursor|array> sortField="order"}} {{#sortable items=<collection|cursor|array> sortField="order"}}
``` ```
Along with `items`, `sortField` is the only Meteor-specific option. If it's missing, the package will Along with `items`, `sortField` is the only Meteor-specific option. If it's missing, the package will
@ -39,8 +39,8 @@ reorderings, unlike with [naive solutions](http://programmers.stackexchange.com/
## Passing options to the Sortable library ## Passing options to the Sortable library
{{sortable items=<collection|cursor|array> option1=value1 option2=value2...}} {{#sortable items=<collection|cursor|array> option1=value1 option2=value2...}}
{{sortable items=<collection|cursor|array> options=myOptions}} {{#sortable items=<collection|cursor|array> options=myOptions}}
For available options, please refer to [the main README](../README.md#options). You can pass them directly For available options, please refer to [the main README](../README.md#options). You can pass them directly
or under the `options` object. Direct options (`key=value`) override those in `options`. It is best or under the `options` object. Direct options (`key=value`) override those in `options`. It is best
@ -49,7 +49,7 @@ object, as this will enable designers to work without needing to inspect the Jav
<template name="myTemplate"> <template name="myTemplate">
... ...
{{sortable items=Players handle=".sortable-handle" ghostClass="sortable-ghost" options=playerOptions}} {{#sortable items=Players handle=".sortable-handle" ghostClass="sortable-ghost" options=playerOptions}}
</template> </template>
Define the options in a helper for the template that calls Sortable: Define the options in a helper for the template that calls Sortable:
@ -76,7 +76,7 @@ All the original Sortable events are supported. In addition, they will receive
the data context in `event.data`. You can access `event.data.order` this way: the data context in `event.data`. You can access `event.data.order` this way:
```handlebars ```handlebars
{{sortable items=players options=playersOptions}} {{#sortable items=players options=playersOptions}}
``` ```
```js ```js
@ -104,3 +104,4 @@ If you encounter an issue while using this package, please CC @dandv when you fi
* Array support * Array support
* Tests * Tests
* Misc. - see reactivize.js * Misc. - see reactivize.js
* [GitHub issues](https://github.com/RubaXa/Sortable/labels/%E2%98%84%20meteor)

Loading…
Cancel
Save