Mavo

Collections

Collections are repeatable elements. They are specified by adding an mv-multiple attribute to properties. Mavo creates controls for adding, deleting, and rearranging items, as well as keyboard shortcuts for these.

mv-accepts

By default, collection items can only be dragged either within the same collection, or to collections of the same type. The mv-accepts attribute takes a space-separated list of property names as its value and is specified on properties with mv-multiple. When specified, the current collection can accept items from those other collections as well.

Note that if you want to drag and drop items between two collections, you will need to specify mv-accepts twice, once on each collection.

An example of mv-accepts can be found in the Decisions demo. Try dragging pros to cons or vice versa.

mv-order

mv-order="desc" does not sort the collection. Instead, it affects the behavior of the controls that add new items. The main add button of the collection is placed before the collection, and inserts new items at the top. The add buttons on each item always add in the opposite direction than the main add button, so they add new items after the item they are on.

An example of mv-order="desc" can be found in the following demos: