Mixed ng.Sortable.get_value ([Boolean all_targets = true]) vs. 1.2.2 Full+Lite

Gets an array (or object or arrays for all targets) with the Sortable Elements in order with all sorting values.

Each target array will consist of objects with the following values:
  • depth: An integer of the element, 0 based (0 is root element).
  • position An integer of the element position based on 0 (0 is the first element). Child elements do not start at 0 but continues the current sort count.
  • id: The element id or sort variable defined by the sort_var option.
  • parent: The parent element id or sort variable defined by the sort_var options. This value will be null for root elements.

Parameters

Boolean all_targets (Optional - Default: true) vs. 1.2.2 Full+Lite
True or false to get all the targets values or just the current sortable object value.

Return

Mixed Required vs. 1.2.2 Full+Lite
An array (for single target) or an object of arrays with multiple targets with all the sort values.

Examples

Sortable Values
This example will demonstrate how to get the value of the sortable objects.
Demo:
  • UL 1 - LI 1
  • UL 1 - LI 2
  • UL 1 - LI 3
  • UL 1 - LI 4
  • UL 1 - LI 5
  • UL 1 - LI 6
  • UL 2 - LI 1
  • UL 2 - LI 2
  • UL 2 - LI 3
  • UL 2 - LI 4
  • UL 2 - LI 5
  • UL 2 - LI 6