# vim: sw=3 ts=3 ft=org

#+TITLE: Sort Block Element Element
#+STYLE: <LINK href='../stylesheet.css' rel='stylesheet' type='text/css' />
#+AUTHOR: Rusty Klophaus (@rustyio)
#+OPTIONS:   H:2 num:1 toc:1 \n:nil @:t ::t |:t ^:t -:t f:t *:t <:t
#+EMAIL: 
#+TEXT: [[file:../index.org][Getting Started]] | [[file:../api.org][API]] | [[file:../elements.org][*Elements*]] | [[file:../actions.org][Actions]] | [[file:../validators.org][Validators]] | [[file:../handlers.org][Handlers]] | [[file:../config.org][Configuration Options]] | [[file:../about.org][About]]

* Sort Block Element - #sortblock {}

  The sort block element allows you to make a list of Nitrogen elements sortable by the user.

** Usage

#+BEGIN_SRC erlang
   #sortblock { tag=block1, items=[
     #sortitem { tag=item1, body="Item 1" },
     #sortitem { tag=item2, body="Item 2" },
     #sortitem { tag=item3, body="Item 3" }
   ]}
#+END_SRC

** Attributes

   + tag - (/Erlang term/) :: The term to pass into the sort\_event/2 event.

   + items - (/list of #sortitem elements/) :: The #sortitem elements that will be sortable.

   + group - (/atom or string/) :: The name of this sortable group.

   + connect\_with\_groups - (/list of atoms or strings/) :: The other groups that can accept items from this group.

   + handle - (/atom or string/) :: A CSS class that will be used as the drag handle for #sortitems.

** Callbacks

*** sort\_event(BlockTag, ListOfItemTags)

Called when the user sorts elements. BlockTag is the tag associated with this sort block. ListOfItemTags is a list of item tags in the new order specified by the user.

** See Also

   + [[./sortitem.html][sortitem element]]

 
